Compare commits
No commits in common. "13d35c76b262e167aa457dc9e52f74fb36379778" and "50ea65da101e22cf643f42fde773f1b81a8bed45" have entirely different histories.
13d35c76b2
...
50ea65da10
|
@ -1,2 +1,3 @@
|
|||
.environment
|
||||
.firefox_env
|
||||
hardware-configuration.nix
|
||||
|
|
56
LICENSE
|
@ -617,3 +617,59 @@ reviewing courts shall apply local law that most closely approximates
|
|||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attac
100 35149 100 35149 0 0 145k 0 --:--:-- --:--:-- --:--:-- 145k
|
||||
h the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
|
|
43
README.md
|
@ -1,35 +1,26 @@
|
|||
randomuser's dotfiles
|
||||
=====================
|
||||
|
||||
![an image of the desktop while editing this repo's flake.nix](./demo.png)
|
||||
here's some dotfiles!
|
||||
|
||||
features
|
||||
--------
|
||||
some features
|
||||
|
||||
- `bspwm` + `sxhkd` + `st` + `firefox`
|
||||
- most everything on the desktop save for the browser, media viewers, and desktop background, is a terminal
|
||||
- on the server, runs gitea + simple-nixos-mailserver
|
||||
- built with NixOS flakes
|
||||
- ``bspwm`` + ``sxhkd``
|
||||
- ``tmenu``: terminal based ``dmenu`` replacement
|
||||
- uses ``pash``, the password manager
|
||||
- no flakes (can't figure it out, lol)
|
||||
|
||||
installation
|
||||
------------
|
||||
some future things to work on are
|
||||
|
||||
`sudo nixos-rebuild --flake .#your-flake-name-here switch`
|
||||
- remove ``polybar`` with a simpler, homegrown solution
|
||||
- integrate a dynamic color switching mechanism
|
||||
- make these more appealing, in general
|
||||
- without compromising speed and system load
|
||||
- compatibility with 'traditional' unix systems
|
||||
|
||||
if you're trying to install `virtbox`, then use the `--impure` flag:
|
||||
license.
|
||||
|
||||
`sudo nixos-rebuild --flake .#virtbox switch --impure`
|
||||
|
||||
for alternate installations on non-NixOS hosts, a Makefile will be made available
|
||||
|
||||
things to do
|
||||
------------
|
||||
|
||||
- integrate `disko` and `sops-nix` into the setup
|
||||
- switch from gitea to cgit
|
||||
- establish backup infrastructure for `netbox`
|
||||
|
||||
license
|
||||
-------
|
||||
|
||||
all materials, except `./home/wallpapers/pape.jpg`, is licensed under the GPLv3. the licensing status of `pape.jpg` is unknown.
|
||||
- boring legal stuff for most items in this configuration are in the LICENSE file.
|
||||
- under the GPLv3
|
||||
- everything under ``config/*``, ``builds/*``, and ``modules/*``, in addition to all files that are ``*.nix``.
|
||||
- NOT in ``wallpapers/*``, those are unlicensed and their legal status is unknown
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
|
||||
|
||||
# Provide an initial copy of the NixOS channel so that the user
|
||||
# doesn't need to run "nix-channel --update" first.
|
||||
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
|
||||
];
|
||||
}
|
|
@ -1,5 +1,15 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
{
|
||||
imports = [
|
||||
../common/steam.nix
|
||||
../common/desktop.nix
|
||||
];
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
|
||||
networking.hostName = "mainsail";
|
||||
|
||||
services.paperless = {
|
||||
enable = true;
|
||||
passwordFile = "/etc/paperless-password";
|
||||
|
@ -42,6 +52,34 @@
|
|||
systemd.targets.hibernate.enable = false;
|
||||
systemd.targets.hybrid-sleep.enable = false;
|
||||
|
||||
services.getty.greetingLine = "
|
||||
welcome to mainsail |`-:_
|
||||
,----....____ | `+.
|
||||
( ````----....|___ |
|
||||
\\ _ ````----....____
|
||||
\\ _) ```---.._
|
||||
\\ \\
|
||||
)`.\\ )`. )`. )`. )`. )`. )`. )`. )`. )`. )`.
|
||||
-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `
|
||||
";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
vscodium-fhs
|
||||
libreoffice
|
||||
|
||||
anki-bin
|
||||
ytfzf
|
||||
kdenlive
|
||||
libreoffice
|
||||
i3
|
||||
gcc
|
||||
gnumake
|
||||
|
||||
scrcpy
|
||||
thunderbird
|
||||
mepo
|
||||
];
|
||||
|
||||
systemd.services.paperless-web-bridge = {
|
||||
script = ''
|
||||
${pkgs.openssh}/bin/ssh -v -NR 3004:localhost:3004 -oExitOnForwardFailure=yes -p 55555 useracc@beepboop.systems
|
|
@ -1,46 +0,0 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./server.nix
|
||||
../../modules/bootstrap.nix
|
||||
../../modules/common.nix
|
||||
../../modules/x11.nix
|
||||
../../modules/discord.nix
|
||||
];
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
|
||||
networking.hostName = "mainsail";
|
||||
|
||||
services.getty.greetingLine = "
|
||||
welcome to mainsail |`-:_
|
||||
,----....____ | `+.
|
||||
( ````----....|___ |
|
||||
\\ _ ````----....____
|
||||
\\ _) ```---.._
|
||||
\\ \\
|
||||
)`.\\ )`. )`. )`. )`. )`. )`. )`. )`. )`. )`.
|
||||
-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `
|
||||
";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
vscodium-fhs
|
||||
libreoffice
|
||||
|
||||
anki-bin
|
||||
ytfzf
|
||||
kdenlive
|
||||
libreoffice
|
||||
i3
|
||||
gcc
|
||||
gnumake
|
||||
|
||||
scrcpy
|
||||
thunderbird
|
||||
mepo
|
||||
];
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/7b70ab88-296c-4737-90b2-267cb2432dc1";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{ lib, inputs, config, pkgs, home, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../home/x11.nix
|
||||
];
|
||||
|
||||
home.stateVersion = "23.11";
|
||||
}
|
|
@ -2,13 +2,10 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
# ./hardware-configuration.nix
|
||||
./nvidia.nix
|
||||
../../modules/bootstrap.nix
|
||||
../../modules/common.nix
|
||||
../../modules/x11.nix
|
||||
../../modules/discord.nix
|
||||
../../modules/gaming.nix
|
||||
../common/desktop.nix
|
||||
../common/nvidia.nix
|
||||
../common/gaming.nix
|
||||
../common/steam.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
|
@ -3,52 +3,13 @@
|
|||
{
|
||||
imports =
|
||||
[
|
||||
./hardware-configuration.nix
|
||||
../../modules/bootstrap.nix
|
||||
../modules/mail.nix
|
||||
../common/main.nix
|
||||
];
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
time.timeZone = "America/Chicago";
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "us";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
htop
|
||||
git
|
||||
tree
|
||||
dig
|
||||
htop
|
||||
gnumake
|
||||
];
|
||||
|
||||
system.copySystemConfiguration = true;
|
||||
system.stateVersion = "23.05"; # don't change this, lol
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
|
||||
# services.cgit = {
|
||||
# "beepboop.systems" = {
|
||||
# extraConfig = ''
|
||||
# root-desc="testing"
|
||||
#
|
||||
# section=main
|
||||
# repo.url=dot_testing
|
||||
# repo.path=/var/lib/git/dot_testing
|
||||
# repo.desc=configuration for NixOS/Linux systems
|
||||
# repo.owner=rndusr
|
||||
#
|
||||
# readme=:README.md
|
||||
# '';
|
||||
# enable = true;
|
||||
# };
|
||||
# };
|
||||
|
||||
networking.hostName = "netbox";
|
||||
|
||||
services.radicale = {
|
||||
|
@ -130,6 +91,15 @@
|
|||
extraGroups = [ "wheel" "docker" ];
|
||||
};
|
||||
|
||||
users.users.paperlesspassthrough = {
|
||||
isNormalUser = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
# nothing more needed, at the moment
|
||||
];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [55555];
|
||||
|
@ -139,12 +109,15 @@
|
|||
services.endlessh.port = 22;
|
||||
services.vaultwarden.enable = true;
|
||||
services.vaultwarden.config = {
|
||||
DOMAIN = "https://bitwarden.beepboop.systems";
|
||||
SIGNUPS_ALLOWED = false;
|
||||
DOMAIN = "https://bitwarden.beepboop.systems";
|
||||
# SIGNUPS_ALLOWED = false;
|
||||
ADMIN_TOKEN = "an_amazing_token_xd";
|
||||
};
|
||||
|
||||
networking.usePredictableInterfaceNames = false;
|
||||
|
||||
services.nixosmail.enable = true;
|
||||
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
appName = "crappy code"; # Give the site a name
|
||||
|
@ -191,6 +164,12 @@
|
|||
locations."/".proxyPass = "http://localhost:3001";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."paperless.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/".proxyPass = "http://localhost:3004";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."bit.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
|
@ -241,19 +220,19 @@
|
|||
email = "nickforanick@protonmail.com";
|
||||
};
|
||||
|
||||
# services.roundcube = {
|
||||
# enable = true;
|
||||
# # this is the url of the vhost, not necessarily the same as the fqdn of
|
||||
# # the mailserver
|
||||
# hostName = "cube.beepboop.systems";
|
||||
# extraConfig = ''
|
||||
# # starttls needed for authentication, so the fqdn required to match
|
||||
# # the certificate
|
||||
# $config['smtp_server'] = "tls://${config.mailserver.fqdn}";
|
||||
# $config['smtp_user'] = "%u";
|
||||
# $config['smtp_pass'] = "%p";
|
||||
# '';
|
||||
# };
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
# this is the url of the vhost, not necessarily the same as the fqdn of
|
||||
# the mailserver
|
||||
hostName = "cube.beepboop.systems";
|
||||
extraConfig = ''
|
||||
# starttls needed for authentication, so the fqdn required to match
|
||||
# the certificate
|
||||
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."roundcube.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
|
@ -271,4 +250,14 @@
|
|||
enable = true;
|
||||
allowedTCPPorts = [ 5232 55555 22 80 443 ];
|
||||
};
|
||||
|
||||
# services.paperless = {
|
||||
# enable = true;
|
||||
# passwordFile = "/etc/paperless-password";
|
||||
# port = 3004;
|
||||
# address = "localhost";
|
||||
# extraConfig = {
|
||||
# PAPERLESS_URL = "https://paperless.beepboop.systems";
|
||||
# };
|
||||
# };
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/a57b82ca-7bfd-458e-b3e8-4962511cc0b8";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/DF39-1ECE";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/57fbd850-1ced-4e21-9e52-4f3b529c61b0"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.ens3.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
virtualisation.hypervGuest.enable = true;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../common/desktop.nix
|
||||
];
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
|
||||
networking.hostName = "virtbox";
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules/bootstrap.nix
|
||||
../../modules/common.nix
|
||||
../../modules/x11.nix
|
||||
../../modules/discord.nix
|
||||
];
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
|
||||
networking.hostName = "virtbox";
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/7b70ab88-296c-4737-90b2-267cb2432dc1";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{ lib, inputs, config, pkgs, home, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../home/x11.nix
|
||||
];
|
||||
|
||||
home.stateVersion = "23.11";
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules/bootstrap.nix
|
||||
../../modules/common.nix
|
||||
../../modules/x11.nix
|
||||
../../modules/tlp.nix
|
||||
../../modules/media.nix
|
||||
../../modules/anki.nix
|
||||
../../modules/power-control.nix
|
||||
../../modules/adb.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
xscreensaver
|
||||
thunderbird
|
||||
];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="input", KERNEL=="event[0-20]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", MODE:="0666" GROUP="usr", SYMLINK+="input/touchscreen"
|
||||
'';
|
||||
|
||||
users.users.usr.extraGroups = [ "input" ];
|
||||
|
||||
services.getty.autologinUser = "usr";
|
||||
|
||||
boot.loader = {
|
||||
grub.timeoutStyle = "hidden";
|
||||
timeout = 0;
|
||||
grub.enable = true;
|
||||
grub.device = "/dev/sda";
|
||||
};
|
||||
|
||||
hardware.pulseaudio.enable = true;
|
||||
|
||||
|
||||
networking.hostName = "x230t";
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/772f67d6-9434-42f1-aa3e-153e41affe4c";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp0s25.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{ lib, inputs, config, pkgs, home, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../home/x11.nix
|
||||
../../home/chromium
|
||||
];
|
||||
|
||||
home.stateVersion = "23.11";
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../common/desktop.nix
|
||||
../common/steam.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnome.cheese
|
||||
musescore
|
||||
libsForQt5.kdenlive
|
||||
xdotool
|
||||
texlive.combined.scheme-full
|
||||
zathura
|
||||
lilypond
|
||||
virt-manager
|
||||
# virtualbox
|
||||
xsane
|
||||
android-studio
|
||||
mpc-cli
|
||||
emacs
|
||||
nyxt
|
||||
cmus
|
||||
];
|
||||
|
||||
# users.extraGroups.vboxusers.members = [ "usr" ];
|
||||
# virtualisation.virtualbox.host.enable = true;
|
||||
# virtualisation.virtualbox.host.enableExtensionPack = true;
|
||||
|
||||
services.tlp.enable = true;
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
services.printing.enable = true;
|
||||
services.avahi.enable = true;
|
||||
services.avahi.nssmdns = true;
|
||||
# for a WiFi printer
|
||||
services.avahi.openFirewall = true;
|
||||
|
||||
networking.nameservers = [ "1.1.1.1" "9.9.9.9" ];
|
||||
|
||||
networking.hostName = "xps";
|
||||
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.dconf.enable = true;
|
||||
users.users.usr.extraGroups = [ "libvirtd" ];
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1703467016,
|
||||
"narHash": "sha256-/5A/dNPhbQx/Oa2d+Get174eNI3LERQ7u6WTWOlR1eQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d02d818f22c777aa4e854efc3242ec451e5d462a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-23.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, ... }:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
withSystem =
|
||||
f:
|
||||
lib.fold lib.recursiveUpdate { } (
|
||||
map f [
|
||||
"x86_64-linux"
|
||||
]
|
||||
);
|
||||
mkPackages = pkgs: {
|
||||
st = pkgs.callPackage ./st.nix { };
|
||||
rebuild = pkgs.callPackage ./rebuild.nix { };
|
||||
utils = pkgs.callPackage ./utils.nix { };
|
||||
};
|
||||
in
|
||||
withSystem (
|
||||
system: {
|
||||
overlays.default = final: _: mkPackages final;
|
||||
|
||||
packages.${system} = mkPackages nixpkgs.legacyPackages.${system};
|
||||
}
|
||||
);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, bash
|
||||
, gnupg
|
||||
, makeWrapper
|
||||
, fetchgit
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pash";
|
||||
version = "1.00";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://git.beepboop.systems/rndusr/pash";
|
||||
sha256 = "sha256-0L3N7F4BwVdu4rR5xpUEIHcX/x64Gni8JTUki5kGH24=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper gnupg ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp $src/pash $out/bin/pash
|
||||
wrapProgram $out/bin/pash --prefix PATH : ${lib.makeBinPath [ bash ]}
|
||||
'';
|
||||
|
||||
phases = [ "installPhase" ];
|
||||
}
|
|
@ -1,6 +1,2 @@
|
|||
cd ~/dot_testing
|
||||
if [ -f "flake.nix" ]; then
|
||||
sudo nixos-rebuild --flake . switch $@
|
||||
else
|
||||
sudo nixos-rebuild -I nixos-config=./boxes/$(hostname).nix switch $@
|
||||
fi
|
||||
sudo nixos-rebuild -I nixos-config=./boxes/$(hostname).nix switch $@
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "st";
|
||||
version = "1.02";
|
||||
version = "69.19";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://git.beepboop.systems/rndusr/st";
|
||||
sha256 = "sha256-zdID1SUnTO/zl90EG8TguBNYYCnrnqFnSLz32kQZbng=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config fontconfig freetype ncurses ];
|
||||
nativeBuildInputs = [ pkg-config fontconfig freetype ncurses];
|
||||
buildInputs = [ libX11 libXft ] ++ extraLibs;
|
||||
|
||||
buildPhase = ''
|
||||
|
|
|
@ -1,45 +1,35 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
# for statusbar
|
||||
, pkg-config
|
||||
, libxcb
|
||||
# shell scripts stuff
|
||||
, makeWrapper
|
||||
, sxhkd
|
||||
, bash
|
||||
, feh
|
||||
, jq
|
||||
, ffmpeg
|
||||
, fzy
|
||||
, figlet
|
||||
, curl
|
||||
, ytfzf
|
||||
, xrandr
|
||||
, makeWrapper
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "utils";
|
||||
version = "1.01";
|
||||
version = "1.00";
|
||||
|
||||
src = ./utils;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper pkg-config libxcb ];
|
||||
buildInputs = [ libxcb bash feh xrandr jq curl fzy ytfzf ffmpeg ];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ bash feh xrandr jq curl ];
|
||||
|
||||
buildPhase = ''
|
||||
ls
|
||||
make
|
||||
'';
|
||||
buildPhase = "";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
for i in $(ls $src/sh); do
|
||||
cp $src/sh/$i $out/bin
|
||||
ln -sf $out/bin/tmenu_run $out/bin/regenerate
|
||||
wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl fzy ytfzf ffmpeg ]}
|
||||
wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl ]}
|
||||
done
|
||||
|
||||
cp c/status/main $out/bin/statusbar
|
||||
'';
|
||||
|
||||
phases = [ "buildPhase" "installPhase" ];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
.PHONY: main
|
||||
main:
|
||||
make -C c/status -f Makefile
|
|
@ -1,2 +0,0 @@
|
|||
main
|
||||
*.o
|
|
@ -1,9 +0,0 @@
|
|||
LDFLAGS=`pkg-config --cflags --libs xcb`
|
||||
CFLAGS=-ggdb -fsanitize=address
|
||||
main: battery.o bspwm.o time.o battstatus.o
|
||||
|
||||
clean:
|
||||
rm *.o main
|
||||
|
||||
run:
|
||||
./main
|
|
@ -1,4 +0,0 @@
|
|||
status
|
||||
------
|
||||
|
||||
a simple statusbar script thing (tm)
|
|
@ -1,38 +0,0 @@
|
|||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "battery.h"
|
||||
#include "common.h"
|
||||
|
||||
/* config contains a path to the battery */
|
||||
int mod_battery(char *config, char *name, char *pipename) {
|
||||
struct message msg;
|
||||
strcpy(msg.name, name);
|
||||
|
||||
int fd = open(pipename, O_WRONLY);
|
||||
int battery;
|
||||
int recvd;
|
||||
|
||||
chdir("/sys/class/power_supply");
|
||||
chdir(config);
|
||||
|
||||
for(;;) {
|
||||
battery = open("capacity", O_RDONLY);
|
||||
recvd = read(battery, msg.content, 3);
|
||||
msg.content[3] = '\0';
|
||||
if (msg.content[2] == '\n') {
|
||||
msg.content[2] = '\0';
|
||||
}
|
||||
close(battery);
|
||||
write(fd, &msg, sizeof(msg));
|
||||
|
||||
sleep(30);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef STATUS_BATTERY_H
|
||||
#define STATUS_BATTERY_H
|
||||
|
||||
int mod_battery(char *config, char *name, char *pipename);
|
||||
|
||||
#endif
|
|
@ -1,48 +0,0 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "battstatus.h"
|
||||
#include "common.h"
|
||||
|
||||
int mod_battstatus(char *config, char *name, char *pipename) {
|
||||
char status;
|
||||
int battery;
|
||||
struct message msg;
|
||||
strcpy(msg.name, name);
|
||||
|
||||
int fd = open(pipename, O_WRONLY);
|
||||
|
||||
chdir("/sys/class/power_supply");
|
||||
chdir(config);
|
||||
|
||||
for(;;) {
|
||||
battery = open("status", O_RDONLY);
|
||||
read(battery, msg.content, 1);
|
||||
switch(msg.content[0]) {
|
||||
case 'N': /* not charging */
|
||||
msg.content[0] = '-';
|
||||
break;
|
||||
case 'C': /* charging */
|
||||
msg.content[0] = '^';
|
||||
break;
|
||||
case 'D': /* discharging */
|
||||
msg.content[0] = 'U';
|
||||
break;
|
||||
case 'U': /* unknown */
|
||||
msg.content[0] = '?';
|
||||
break;
|
||||
default: /* what's going on? */
|
||||
msg.content[0] = '!';
|
||||
break;
|
||||
}
|
||||
msg.content[1] = '\0';
|
||||
close(battery);
|
||||
write(fd, &msg, sizeof(msg));
|
||||
|
||||
sleep(30);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef STATUS_BATTSTAT_H
|
||||
#define STATUS_BATTSTAT_H
|
||||
|
||||
int mod_battstatus(char *config, char *name, char *pipename);
|
||||
|
||||
#endif
|
|
@ -1,142 +0,0 @@
|
|||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <xcb/xcb.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "bspwm.h"
|
||||
#include "common.h"
|
||||
|
||||
const char subscribe[] = "subscribe";
|
||||
|
||||
int get_socket(void) {
|
||||
struct sockaddr_un sock;
|
||||
char *host;
|
||||
int displaynumber, screennumber;
|
||||
int fd;
|
||||
|
||||
xcb_parse_display(NULL, &host, &displaynumber, &screennumber);
|
||||
|
||||
sock.sun_family = AF_UNIX;
|
||||
snprintf(
|
||||
sock.sun_path,
|
||||
sizeof(sock.sun_path), "/tmp/bspwm%s_%i_%i-socket",
|
||||
host, displaynumber, screennumber
|
||||
);
|
||||
|
||||
free(host);
|
||||
|
||||
fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (connect(
|
||||
fd,
|
||||
(struct sockaddr *) &sock,
|
||||
sizeof(sock)
|
||||
) == -1) {
|
||||
return -1;
|
||||
} else {
|
||||
return fd;
|
||||
}
|
||||
}
|
||||
|
||||
int should_be_shown(char c) {
|
||||
return c == 'O' || c == 'o' || c == 'F' || c == 'U' || c == 'u';
|
||||
}
|
||||
|
||||
int is_a_desktop(char c) {
|
||||
return c == 'O' || c == 'o' || c == 'F' || c == 'f' || c == 'U' || c == 'u';
|
||||
}
|
||||
|
||||
/* XXX: this function has the potential to buffer overflow by ONE BYTE.
|
||||
* probably fix this? */
|
||||
void print_desktop_status(char *in, char *out, int outlen) {
|
||||
int written;
|
||||
int i;
|
||||
char c;
|
||||
|
||||
/* flags */
|
||||
int read_colon;
|
||||
int skip_to_next_colon;
|
||||
int read_until_colon;
|
||||
int is_first_desktop;
|
||||
int last_was_desktop;
|
||||
|
||||
i = 0;
|
||||
written = 0;
|
||||
read_colon = 1;
|
||||
skip_to_next_colon = 0;
|
||||
read_until_colon = 0;
|
||||
is_first_desktop = 1;
|
||||
last_was_desktop = 0;
|
||||
|
||||
for(;;) {
|
||||
c = in[i];
|
||||
|
||||
if(!c) break;
|
||||
if(written == outlen) break;
|
||||
|
||||
if (skip_to_next_colon) {
|
||||
if (c == ':') {
|
||||
skip_to_next_colon = 0;
|
||||
read_until_colon = 0;
|
||||
read_colon = 1;
|
||||
} else if (read_until_colon) {
|
||||
out[written] = c;
|
||||
written++;
|
||||
}
|
||||
} else if (read_colon && should_be_shown(c)) {
|
||||
if (!is_first_desktop) {
|
||||
out[written] = ' ';
|
||||
written++;
|
||||
}
|
||||
|
||||
switch(c) {
|
||||
case 'O':
|
||||
case 'F': /* fallthrough */
|
||||
out[written] = '*';
|
||||
written++;
|
||||
break;
|
||||
}
|
||||
|
||||
skip_to_next_colon = 1;
|
||||
read_until_colon = 1;
|
||||
read_colon = 0;
|
||||
is_first_desktop = 0;
|
||||
last_was_desktop = 1;
|
||||
} else if (read_colon && is_a_desktop(c)) {
|
||||
last_was_desktop = 1;
|
||||
} else {
|
||||
if(last_was_desktop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
out[written] = '\0';
|
||||
}
|
||||
|
||||
int mod_bspwm(char *config, char *name, char *pipename) {
|
||||
struct message msg;
|
||||
int fd, bspcfd;
|
||||
char in[BUFFER_SIZE];
|
||||
|
||||
strcpy(msg.name, name);
|
||||
msg.flags = 0;
|
||||
|
||||
fd = open(pipename, O_WRONLY);
|
||||
bspcfd = get_socket();
|
||||
|
||||
send(bspcfd, subscribe, sizeof(subscribe), 0);
|
||||
|
||||
for(;;) {
|
||||
int recvd = recv(bspcfd, in, BUFFER_SIZE, 0);
|
||||
print_desktop_status(in, msg.content, 512);
|
||||
write(fd, &msg, sizeof(msg));
|
||||
memset(msg.content, 0, 512);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef STATUS_BSPWM_H
|
||||
#define STATUS_BSPWM_H
|
||||
|
||||
int mod_bspwm(char *config, char *name, char *pipename);
|
||||
|
||||
#endif
|
|
@ -1,21 +0,0 @@
|
|||
#ifndef STATUS_COMMON_H
|
||||
#define STATUS_COMMON_H
|
||||
|
||||
#define LENGTH(x) sizeof(x) / sizeof(x[0])
|
||||
#define BUFFER_SIZE 512
|
||||
|
||||
struct module {
|
||||
int (*fork_callback)(char *config, char *name, char *pipename);
|
||||
char name[16];
|
||||
char config[512];
|
||||
char buffer[512];
|
||||
int buflen;
|
||||
};
|
||||
|
||||
struct message {
|
||||
int flags;
|
||||
char name[16];
|
||||
char content[512];
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,91 +0,0 @@
|
|||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/un.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "battery.h"
|
||||
#include "battstatus.h"
|
||||
#include "bspwm.h"
|
||||
#include "time.h"
|
||||
|
||||
struct module mods[] = {
|
||||
{mod_battery, "battery", "BAT0", { '\0' }},
|
||||
{mod_battstatus, "battstatus", "BAT0", { '\0' }},
|
||||
{mod_time, "time", "", { '\0' }},
|
||||
/* {mod_bspwm, "bspwm", "", { '\0' }}, not working at the moment */
|
||||
};
|
||||
|
||||
void create_module_proc(int index, char *pipename) {
|
||||
pid_t pid = fork();
|
||||
|
||||
if (pid == 0) { /* we're the child */
|
||||
mods[index].fork_callback(
|
||||
mods[index].config,
|
||||
mods[index].name,
|
||||
pipename
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void create_module_procs(char *pipename) {
|
||||
for(int i = 0; i < LENGTH(mods); i++) {
|
||||
create_module_proc(i, pipename);
|
||||
}
|
||||
}
|
||||
|
||||
void redraw() {
|
||||
/* get the progress' module's value, convert it to int, and then
|
||||
* figure out how much of the screen should be shaded in */
|
||||
|
||||
printf("\033[H\033[2J");
|
||||
for(int i = 0; i < LENGTH(mods); i++) {
|
||||
if (i == 0) printf("%s ", mods[i].buffer);
|
||||
else printf("| %s ", mods[i].buffer);
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static char NAMED_PIPE[] = "/home/usr/.cache/statusbar_pipe";
|
||||
|
||||
int main(void) {
|
||||
char pipename[BUFFER_SIZE];
|
||||
srand(time(NULL));
|
||||
strcpy(pipename, &NAMED_PIPE);
|
||||
pipename[sizeof(NAMED_PIPE) - 1] = 'A' + (rand() % 26);
|
||||
pipename[sizeof(NAMED_PIPE)] = 'A' + (rand() % 26);
|
||||
pipename[sizeof(NAMED_PIPE) + 1] = '\0';
|
||||
mkfifo(pipename, 0666);
|
||||
int fd = open(pipename, O_RDWR);
|
||||
struct message msg;
|
||||
|
||||
create_module_procs(pipename);
|
||||
|
||||
for (;;) {
|
||||
int ret = read(fd, &msg, sizeof(msg));
|
||||
if(ret < 0) {
|
||||
printf("error while reading message from child\n");
|
||||
}
|
||||
|
||||
for(int i = 0; i < LENGTH(mods); i++) {
|
||||
if(strcmp(mods[i].name, msg.name) == 0) {
|
||||
mods[i].buflen = strlen(msg.content);
|
||||
strcpy(mods[i].buffer, msg.content);
|
||||
redraw();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
with import <nixpkgs> {};
|
||||
pkgs.mkShell {
|
||||
nativeBuildInputs = [
|
||||
gdb
|
||||
gnumake
|
||||
pkg-config
|
||||
xorg.libxcb
|
||||
];
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "time.h"
|
||||
|
||||
int mod_time(char *config, char *name, char *pipename) {
|
||||
struct message msg;
|
||||
time_t now;
|
||||
struct tm *tm;
|
||||
int fd;
|
||||
|
||||
strcpy(msg.name, name);
|
||||
msg.flags = 0;
|
||||
fd = open(pipename, O_WRONLY);
|
||||
|
||||
for(;;) {
|
||||
time(&now);
|
||||
tm = localtime(&now);
|
||||
strftime(msg.content, 512, "%H:%M", tm);
|
||||
write(fd, &msg, sizeof(msg));
|
||||
|
||||
sleep(60);
|
||||
}
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef STATUS_TIME_H
|
||||
#define STATUS_TIME_H
|
||||
|
||||
int mod_time(char *config, char *name, char *pipename);
|
||||
|
||||
#endif
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# get screen info and temporary file
|
||||
tmp=$(mktemp -d)
|
||||
tmp=$(mktemp)
|
||||
res=$(xrandr |
|
||||
grep ' connected' |
|
||||
awk -F' ' '{print $1 " " $4}' |
|
||||
|
@ -11,7 +11,7 @@ res=$(xrandr |
|
|||
|
||||
# still or motion
|
||||
medium=$(printf ".mp4\n.png\n" | fzy)
|
||||
output="$tmp/main$medium"
|
||||
output="$tmp$medium"
|
||||
|
||||
# capture
|
||||
case "$medium" in
|
||||
|
|
|
@ -1,50 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
find_card_pci() {
|
||||
[ -z $pci_path ] && pci_path=$(find /sys/devices | \
|
||||
grep edid | \
|
||||
cut -d/ -f1-6
|
||||
)
|
||||
}
|
||||
|
||||
assert_edid() {
|
||||
find_card_pci
|
||||
|
||||
out=$(sha256sum ${pci_path}/card0/card0-$1/edid | \
|
||||
cut -d' ' -f1)
|
||||
|
||||
[ "$out" = "$2" ] && return 0 || return 1
|
||||
}
|
||||
|
||||
exists() {
|
||||
xrandr | grep ' connected' | grep -c "${1}"
|
||||
}
|
||||
|
||||
case "$(hostname)" in
|
||||
"mainsail")
|
||||
echo "mainsail"
|
||||
xrandr --output VGA-1 --left-of HDMI-1
|
||||
bspc monitor VGA-1 -d 1 3 5 7 9
|
||||
bspc monitor HDMI-1 -d 2 4 6 8 0
|
||||
;;
|
||||
"x230t")
|
||||
echo "x230t"
|
||||
if
|
||||
assert_edid "VGA-1" "35737dc483d2c3b1b20ea2343ce13c6c42d115febdc9634f8437e1b9f7fd3f5c" &&
|
||||
assert_edid "HDMI-A-1" "01887cbd23d74201e489a6334656f7db73a7b7f732a738a9f1ee2d53389f7817";
|
||||
then
|
||||
echo "docked"
|
||||
xrandr --output LVDS-1 --primary --mode 1366x768 --pos 1194x1080 --rotate normal \
|
||||
--output VGA-1 --mode 1920x1080 --pos 0x0 --rotate normal \
|
||||
--output HDMI-1 --mode 1920x1080 --pos 1920x0 --rotate normal \
|
||||
--output DP-1 --off \
|
||||
--output HDMI-2 --off \
|
||||
--output DP-2 --off
|
||||
bspc monitor LVDS-1 -d 1 4 7
|
||||
bspc monitor VGA-1 -d 2 5 8
|
||||
bspc monitor HDMI-1 -d 3 6 9
|
||||
else
|
||||
bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if [ ! "$(hostname)" = "mainsail" ]; then
|
||||
bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9
|
||||
fi
|
||||
|
||||
if [ "$(exists "DP-1")" -gt 1 ]; then
|
||||
printf "two"
|
||||
bspc monitor DP-1 -s eDP-1
|
||||
xrandr --output eDP-1 --off
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(hostname)" = "mainsail" ]; then
|
||||
# this is a tower, so there's only one configuration
|
||||
printf "mainsail detected\n"
|
||||
xrandr --output VGA-1 --left-of HDMI-1
|
||||
bspc monitor VGA-1 -d 1 3 5 7 9
|
||||
bspc monitor HDMI-1 -d 2 4 6 8 0
|
||||
fi
|
||||
|
|
|
@ -1,13 +1,4 @@
|
|||
# mode - change the current effective sxhkd configuration
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
pkill sxhkd
|
||||
sxhkd -c ~/.config/sxhkd/$1 & disown
|
||||
[ -f "~/.config/sxhkd/$1.sh ] && ~/.config/sxhkd/$1.sh
|
||||
|
||||
exit
|
||||
fi
|
||||
|
||||
# we need a menu
|
||||
choice=$(ls ~/.config/sxhkd | tmenu)
|
||||
$0 $choice
|
||||
pkill sxhkd
|
||||
sxhkd -c ~/.config/sxhkd/$1 & disown
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
geos=$(
|
||||
xrandr | \
|
||||
grep ' connected' | \
|
||||
grep -o '[0-9]*x[0-9]*+[0-9]*+[0-9]*' | \
|
||||
awk -F'[x+]' '{print $1 "x20+" $3 "+" $4}'
|
||||
)
|
||||
|
||||
pkill statusbar
|
||||
|
||||
for i in $geos; do
|
||||
st -c statusbar -p -g "$i" -e statusbar & disown
|
||||
done
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
WALLDIR="${HOME}/.local/share/wallpapers"
|
||||
BASECMD="feh --no-fehbg --bg-fill"
|
||||
|
||||
generate_wall () {
|
||||
GENWALL=$( \
|
||||
ls "$WALLDIR" | \
|
||||
grep "." | \
|
||||
shuf -n 1
|
||||
)
|
||||
GENWALL="${WALLDIR}/${GENWALL}"
|
||||
}
|
||||
wall () {
|
||||
generate_wall
|
||||
while [ "${GENWALL}" = "${1}" ]; do
|
||||
generate_wall
|
||||
done
|
||||
}
|
||||
displays () {
|
||||
displays=$(xrandr | grep -c ' connected')
|
||||
}
|
||||
|
||||
cmd=""
|
||||
displays
|
||||
for i in $(seq 1 "$displays"); do
|
||||
wall "${tmp}"
|
||||
tmp="${GENWALL}"
|
||||
cmd="${cmd} ${GENWALL}"
|
||||
done
|
||||
eval "${BASECMD}" "${cmd}"
|
||||
exit 0
|
|
@ -0,0 +1,265 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
|
||||
let
|
||||
home-manager = builtins.fetchTarball {
|
||||
url = "https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz";
|
||||
sha256 = "16078fwcmqq41dqfnm124xxm8l6zykvqlj1kzgi0fvfil4y86slm";
|
||||
};
|
||||
customPolybar = pkgs.polybar.override {
|
||||
alsaSupport = true;
|
||||
pulseSupport = true;
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
"${builtins.fetchTarball "https://github.com/Mic92/sops-nix/archive/master.tar.gz"}/modules/sops"
|
||||
(import "${home-manager}/nixos")
|
||||
./main.nix
|
||||
];
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
libinput.enable = true;
|
||||
layout = "us";
|
||||
|
||||
displayManager.sx.enable = true;
|
||||
};
|
||||
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = true;
|
||||
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [
|
||||
"libxls-1.6.2"
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
sx
|
||||
fzy
|
||||
xclip
|
||||
xcape
|
||||
ffmpeg
|
||||
man-pages
|
||||
|
||||
ncmpcpp
|
||||
pciutils
|
||||
tor-browser-bundle-bin
|
||||
xscreensaver
|
||||
ncpamixer
|
||||
gpick
|
||||
calcurse
|
||||
dunst
|
||||
libnotify
|
||||
tig
|
||||
neomutt
|
||||
mpv
|
||||
yt-dlp
|
||||
zathura
|
||||
tmux
|
||||
lynx
|
||||
feh
|
||||
elinks
|
||||
sc-im
|
||||
ledger
|
||||
remind
|
||||
python3
|
||||
pinentry-curses
|
||||
magic-wormhole
|
||||
xbrightness
|
||||
xdotool
|
||||
figlet
|
||||
neomutt
|
||||
|
||||
unzip
|
||||
lua-language-server
|
||||
rnix-lsp
|
||||
python311Packages.jedi-language-server
|
||||
|
||||
ungoogled-chromium
|
||||
discord
|
||||
|
||||
customPolybar
|
||||
(pkgs.callPackage ../builds/utils.nix {})
|
||||
(pkgs.callPackage ../builds/st.nix {})
|
||||
(pkgs.callPackage ../builds/pash.nix {})
|
||||
];
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
fantasque-sans-mono
|
||||
];
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
pinentryFlavor = "gtk2";
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
policies = {
|
||||
DisableFirefoxStudies = true;
|
||||
DisablePocket = true;
|
||||
DisableTelemetry = {
|
||||
Cryptomining = true;
|
||||
Fingerprinting = true;
|
||||
EmailTracking = true;
|
||||
};
|
||||
DisableFirefoxAccounts = true;
|
||||
DisableFirefoxScreenshots = true;
|
||||
DisableSetDesktopBackground = true;
|
||||
DisplayBookmarksToolbar = "never";
|
||||
DontCheckDefaultBrowser = true;
|
||||
Extensions = {
|
||||
Install = [
|
||||
"https://addons.mozilla.org/firefox/downloads/file/3812704/umatrix-1.4.4.xpi"
|
||||
"https://addons.mozilla.org/firefox/downloads/file/3824639/gruvbox_true_dark-2.0.xpi"
|
||||
"https://addons.mozilla.org/firefox/downloads/file/4128489/darkreader-4.9.64.xpi"
|
||||
"https://addons.mozilla.org/firefox/downloads/file/4036604/tridactyl_vim-1.23.0.xpi"
|
||||
"https://addons.mozilla.org/firefox/downloads/file/4098688/user_agent_string_switcher-0.5.0.xpi"
|
||||
];
|
||||
};
|
||||
FirefoxHome = {
|
||||
Pocket = false;
|
||||
Snippets = false;
|
||||
TopSites = false;
|
||||
SponsoredTopSites = false;
|
||||
};
|
||||
UserMessaging = {
|
||||
ExtensionRecommendations = false;
|
||||
SkipOnboarding = true;
|
||||
MoreFromMozilla = false;
|
||||
UrlbarInterventions = false;
|
||||
WhatsNew = false;
|
||||
};
|
||||
EnableTrackingProtection = true;
|
||||
OverrideFirstRunPage = "";
|
||||
OverridePostUpdatePage = "";
|
||||
PasswordManagerEnabled = false;
|
||||
SearchSuggestEnabled = false;
|
||||
};
|
||||
nativeMessagingHosts.packages = [
|
||||
pkgs.tridactyl-native
|
||||
];
|
||||
};
|
||||
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
musicDirectory = "/home/usr/music";
|
||||
user = "usr";
|
||||
extraConfig = ''
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "Pulseaudio"
|
||||
}
|
||||
audio_output {
|
||||
type "alsa"
|
||||
name "mpd alsamixer-output"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
users.users.usr = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
initialPassword = "usr";
|
||||
packages = with pkgs; [
|
||||
firefox
|
||||
tree
|
||||
bspwm
|
||||
sxhkd
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
# honking impure, but who's counting anyway?
|
||||
system.activationScripts.test-script.text = ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
|
||||
if [ "$(${pkgs.coreutils}/bin/whoami)" = "usr"]; then
|
||||
${pkgs.coreutils}/bin/mkdir -p /home/usr/git
|
||||
${pkgs.git}/bin/git https://git.beepboop.systems/rndusr/dot /home/usr/git/dot
|
||||
${pkgs.git}/bin/git https://git.beepboop.systems/rndusr/privdata /home/usr/git/privdata
|
||||
fi
|
||||
'';
|
||||
|
||||
home-manager.users.usr = {
|
||||
home.stateVersion = "23.05";
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
extraLuaPackages = luaPkgs: with luaPkgs; [ luaexpat ];
|
||||
extraPackages = [ pkgs.sqlite ];
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".config/bash" = {
|
||||
source = ../config/bash;
|
||||
recursive = true;
|
||||
};
|
||||
".config/bspwm" = {
|
||||
source = ../config/bspwm;
|
||||
recursive = true;
|
||||
};
|
||||
".config/git" = {
|
||||
source = ../config/git;
|
||||
recursive = true;
|
||||
};
|
||||
".config/htop" = {
|
||||
source = ../config/htop;
|
||||
recursive = true;
|
||||
};
|
||||
".config/nvim" = {
|
||||
source = ../config/nvim;
|
||||
recursive = true;
|
||||
};
|
||||
".config/python" = {
|
||||
source = ../config/python;
|
||||
recursive = true;
|
||||
};
|
||||
".config/polybar" = {
|
||||
source = ../config/polybar;
|
||||
recursive = true;
|
||||
};
|
||||
".config/sx" = {
|
||||
source = ../config/sx;
|
||||
recursive = true;
|
||||
};
|
||||
".config/sxhkd" = {
|
||||
source = ../config/sxhkd;
|
||||
recursive = true;
|
||||
};
|
||||
".config/tridactyl" = {
|
||||
source = ../config/tridactyl;
|
||||
recursive = true;
|
||||
};
|
||||
".config/zathura" = {
|
||||
source = ../config/zathura;
|
||||
recursive = true;
|
||||
};
|
||||
".local/share/wallpapers" = {
|
||||
source = ../wallpapers;
|
||||
recursive = true;
|
||||
};
|
||||
".local/share/gnupg" = {
|
||||
source = ../config/gnupg;
|
||||
recursive = true;
|
||||
};
|
||||
".config/emacs" = {
|
||||
source = ../config/emacs;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
"profile.local" = {
|
||||
text = "source /home/usr/.config/bash/profile";
|
||||
};
|
||||
"bashrc.local" = {
|
||||
text = "source /home/usr/.config/bash/bashrc";
|
||||
};
|
||||
};
|
||||
|
||||
programs.ssh.askPassword = "";
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
steam-run
|
||||
prismlauncher
|
||||
xonotic
|
||||
minetest
|
||||
];
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
my_neovim = pkgs.neovim.overrideAttrs (oldAttrs: {
|
||||
buildInputs = oldAttrs.buildInputs or [] ++ [ pkgs.luajitPackages.luaexpat ];
|
||||
});
|
||||
in {
|
||||
imports =
|
||||
[
|
||||
../hardware-configuration.nix # include the results of the hardware scan
|
||||
];
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
time.timeZone = "America/Chicago";
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "us";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
htop
|
||||
git
|
||||
tree
|
||||
dig
|
||||
htop
|
||||
gnumake
|
||||
|
||||
(pkgs.callPackage ../builds/rebuild.nix {})
|
||||
];
|
||||
|
||||
system.copySystemConfiguration = true;
|
||||
system.stateVersion = "23.05"; # don't change this, lol
|
||||
}
|
|
@ -7,8 +7,6 @@
|
|||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
prismlauncher
|
||||
xonotic
|
||||
minetest
|
||||
steam-run
|
||||
];
|
||||
}
|
|
@ -54,6 +54,3 @@ export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
|
|||
# source the bashrc(s)
|
||||
[ -f $HOME/.config/bash/bashrc ] && . $HOME/.config/bash/bashrc
|
||||
[ -f $HOME/.bashrc ] && . $HOME/.bashrc
|
||||
|
||||
# if we're interactive and the tty is /dev/tty1 then start xorg
|
||||
[ "$(tty)" = "/dev/tty1" ] && sx
|
|
@ -1,26 +1,11 @@
|
|||
#!/bin/sh
|
||||
# rndusr's bspwmrc
|
||||
|
||||
bspc rule -a st-gpg-menu state=floating
|
||||
bspc rule -a statusbar border=off sticky=on state=floating manage=off
|
||||
bspc rule -a tmenu-prompt border=on sticky=on state=floating
|
||||
bspc rule -a Xmessage border=on state=floating
|
||||
bspc rule -a Zathura state=tiled
|
||||
bspc rule -a generic-st-window state=floating manage=on sticky=on border=on
|
||||
bspc rule -a floating-feh state=floating
|
||||
|
||||
set_walls() {
|
||||
for i in $(xrandr | grep ' connected' | cut -d' ' -f1); do
|
||||
xwallpaper --output $i --zoom ~/.local/share/pape.jpg
|
||||
done
|
||||
}
|
||||
|
||||
# post-wm boilerplate
|
||||
wallpaper
|
||||
disp
|
||||
statuswrap
|
||||
set_walls
|
||||
pkill xscreensaver
|
||||
HOME=".config/xscreensaver" xscreensaver --no-splash &
|
||||
polybar &
|
||||
dunst &
|
||||
|
||||
# set up the color scheme
|
||||
bspc config normal_border_color "#161510"
|
||||
|
@ -31,5 +16,13 @@ bspc config pointer_follows_focus true
|
|||
bspc config pointer_follows_monitor true
|
||||
bspc config focus_follows_pointer true
|
||||
|
||||
bspc config window_gap 0
|
||||
bspc config top_padding 20
|
||||
bspc config window_gap 3
|
||||
#bspc config top_padding 20
|
||||
|
||||
bspc rule -a st-gpg-menu state=floating
|
||||
bspc rule -a statusbar border=off sticky=on state=floating manage=off
|
||||
bspc rule -a tmenu-prompt border=on sticky=on state=floating
|
||||
bspc rule -a Xmessage border=on state=floating
|
||||
bspc rule -a Zathura state=tiled
|
||||
bspc rule -a generic-st-window state=floating manage=on sticky=on border=on
|
||||
bspc rule -a floating-feh state=floating
|
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 851 B |
Before Width: | Height: | Size: 849 B After Width: | Height: | Size: 849 B |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 385 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 777 B |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 591 B After Width: | Height: | Size: 591 B |
Before Width: | Height: | Size: 589 B After Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 385 B |
Before Width: | Height: | Size: 591 B After Width: | Height: | Size: 591 B |
Before Width: | Height: | Size: 589 B After Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 778 B |
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 778 B |
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |