summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.sops.yaml59
-rw-r--r--archetypes/collections/bluetooth.nix12
-rw-r--r--archetypes/collections/desktop/cad.nix21
-rw-r--r--archetypes/collections/desktop/chromium.nix18
-rw-r--r--archetypes/collections/desktop/crypto.nix13
-rw-r--r--archetypes/collections/desktop/default.nix17
-rw-r--r--archetypes/collections/desktop/extra.nix16
-rw-r--r--archetypes/collections/desktop/firefox.nix12
-rw-r--r--archetypes/collections/desktop/graphics.nix16
-rw-r--r--archetypes/collections/desktop/office.nix18
-rw-r--r--archetypes/collections/desktop/pipewire.nix14
-rw-r--r--archetypes/collections/desktop/printing.nix17
-rw-r--r--archetypes/collections/desktop/thumbnailers.nix18
-rw-r--r--archetypes/collections/desktop/utilities.nix32
-rw-r--r--archetypes/collections/desktop/video.nix17
-rw-r--r--archetypes/collections/desktop/xserver.nix34
-rw-r--r--archetypes/collections/development/default.nix45
-rw-r--r--archetypes/collections/development/docker.nix15
-rw-r--r--archetypes/collections/filesystems.nix (renamed from modules/root/software/ddcutil.nix)5
-rw-r--r--archetypes/collections/fonts.nix16
-rw-r--r--archetypes/collections/music.nix30
-rw-r--r--archetypes/collections/neovim.nix18
-rw-r--r--archetypes/collections/nvidia.nix14
-rw-r--r--archetypes/collections/utilities.nix (renamed from modules/root/software/utilities.nix)24
-rw-r--r--archetypes/collections/virtualization.nix21
-rw-r--r--archetypes/default.nix16
-rw-r--r--archetypes/profiles/btrfs/default.nix17
-rw-r--r--archetypes/profiles/cuda/default.nix26
-rw-r--r--archetypes/profiles/default.nix11
-rw-r--r--archetypes/profiles/desktop/default.nix144
-rw-r--r--archetypes/profiles/desktop/resources/fontconfig/90-commit-mono-options.conf17
-rw-r--r--archetypes/profiles/desktop/resources/fontconfig/90-tamzen-disable-anti-aliasing.conf14
-rw-r--r--archetypes/profiles/gnome/default.nix39
-rw-r--r--archetypes/profiles/headless/default.nix33
-rw-r--r--archetypes/profiles/pi/default.nix30
-rw-r--r--archetypes/profiles/zfs/default.nix33
-rw-r--r--derivations/lowbat/default.nix30
-rw-r--r--derivations/pavolctld/default.nix29
-rw-r--r--derivations/st/default.nix50
-rw-r--r--flake.lock270
-rw-r--r--flake.nix157
-rw-r--r--home-manager/default.nix18
-rw-r--r--home-manager/firefox.nix113
-rw-r--r--home-manager/fontconfig.nix11
-rw-r--r--home-manager/gammastep.nix18
-rw-r--r--home-manager/home-cleanup.nix21
-rw-r--r--home-manager/htop.nix46
-rw-r--r--home-manager/mint-theme.nix43
-rw-r--r--home-manager/pcmanfm.nix14
-rw-r--r--home-manager/qt-gtk-theme.nix15
-rw-r--r--home-manager/resources/pcmanfm/root.desktop (renamed from modules/home/resources/pcmanfm/root.desktop)2
-rw-r--r--home-manager/resources/xdg-mime/audio65
-rw-r--r--home-manager/resources/xdg-mime/directory2
-rw-r--r--home-manager/resources/xdg-mime/email6
-rw-r--r--home-manager/resources/xdg-mime/image21
-rw-r--r--home-manager/resources/xdg-mime/pdf4
-rw-r--r--home-manager/resources/xdg-mime/text15
-rw-r--r--home-manager/resources/xdg-mime/video55
-rw-r--r--home-manager/theme-st.nix46
-rw-r--r--home-manager/wallpapers.nix17
-rw-r--r--home-manager/xdg-mime.nix42
-rw-r--r--hosts/T430/configuration.nix78
-rw-r--r--hosts/T430/hardware-configuration.nix46
-rw-r--r--hosts/T430/resources/secrets/wg.yaml18
-rw-r--r--hosts/T430/wg.nix11
-rw-r--r--hosts/X230/configuration.nix65
-rw-r--r--hosts/X230/hardware-configuration.nix (renamed from modules/hosts/T430/hardware-configuration.nix)21
-rw-r--r--hosts/X230/resources/secrets/wg0.yaml16
-rw-r--r--hosts/X230/wg.nix (renamed from modules/hosts/T495/wg.nix)0
-rw-r--r--hosts/flex-wg-router/configuration.nix99
-rw-r--r--hosts/flex-wg-router/hardware-configuration.nix (renamed from modules/hosts/optiplex/hardware-configuration.nix)20
-rw-r--r--hosts/flex-wg-router/resources/secrets/wg.yaml17
-rw-r--r--hosts/flex-wg-router/wg.nix7
-rw-r--r--hosts/gnuslashprinter/configuration.nix29
-rw-r--r--hosts/gnuslashprinter/flask-relay-ctl.nix37
-rw-r--r--hosts/gnuslashprinter/hardware-configuration.nix44
-rw-r--r--hosts/gnuslashprinter/klipper.nix100
-rw-r--r--hosts/gnuslashprinter/resources/flaskrelayctl/pyproject.toml10
-rw-r--r--hosts/gnuslashprinter/resources/flaskrelayctl/server/__init__.py54
-rw-r--r--hosts/gnuslashprinter/resources/klipper/mcu/config109
-rw-r--r--hosts/gnuslashprinter/resources/klipper/printer.cfg180
-rw-r--r--hosts/libreX60/bios-flashing.nix8
-rw-r--r--hosts/libreX60/configuration.nix47
-rw-r--r--hosts/libreX60/hardware-configuration.nix (renamed from modules/hosts/T495/hardware-configuration.nix)19
-rw-r--r--hosts/libreX60/home-timmy/configuration.nix8
-rw-r--r--hosts/libreX60/home.nix22
-rw-r--r--hosts/libreX60/powertop-auto-tune.nix17
-rw-r--r--hosts/office-precision/configuration.nix123
-rw-r--r--hosts/office-precision/g610.nix9
-rw-r--r--hosts/office-precision/hardware-configuration.nix (renamed from modules/hosts/hp-envy-office/hardware-configuration.nix)0
-rw-r--r--hosts/office-precision/resources/secrets/wg.yaml16
-rw-r--r--hosts/office-precision/wg.nix8
-rw-r--r--hosts/optiplex/configuration.nix111
-rw-r--r--hosts/optiplex/hardware-configuration.nix44
-rw-r--r--hosts/piframe/configuration.nix77
-rw-r--r--hosts/piframe/hardware-configuration.nix24
-rw-r--r--hosts/poweredge-pro/cgit.nix105
-rw-r--r--hosts/poweredge-pro/configuration.nix62
-rw-r--r--hosts/poweredge-pro/dhcp-hosts.nix29
-rw-r--r--hosts/poweredge-pro/dns-overrides.nix12
-rw-r--r--hosts/poweredge-pro/dns.nix57
-rw-r--r--hosts/poweredge-pro/embedtube.nix43
-rw-r--r--hosts/poweredge-pro/filebrowser.nix55
-rw-r--r--hosts/poweredge-pro/fileshares.nix92
-rw-r--r--hosts/poweredge-pro/hardware-configuration.nix50
-rw-r--r--hosts/poweredge-pro/key.nix23
-rw-r--r--hosts/poweredge-pro/networking.nix32
-rw-r--r--hosts/poweredge-pro/resources/openssh/zfsbackup/truenas-10.0.0.9-rsa.pub1
-rw-r--r--hosts/poweredge-pro/resources/secrets/embedtube.yaml16
-rw-r--r--hosts/poweredge-pro/resources/secrets/initial-pass.yaml17
-rw-r--r--hosts/poweredge-pro/resources/secrets/zfs-key.yaml16
-rw-r--r--hosts/poweredge-pro/searxng.nix179
-rw-r--r--hosts/poweredge/bitcoind.nix42
-rw-r--r--hosts/poweredge/configuration.nix48
-rw-r--r--hosts/poweredge/ddns-updater.nix22
-rw-r--r--hosts/poweredge/filebrowser.nix36
-rw-r--r--hosts/poweredge/fileshares.nix68
-rw-r--r--hosts/poweredge/gitea.nix41
-rw-r--r--hosts/poweredge/hardware-configuration.nix50
-rw-r--r--hosts/poweredge/immich.nix89
-rw-r--r--hosts/poweredge/jellyfin.nix91
-rw-r--r--hosts/poweredge/metrics.nix43
-rw-r--r--hosts/poweredge/navidrome.nix51
-rw-r--r--hosts/poweredge/networking.nix167
-rw-r--r--hosts/poweredge/notification-mailer.nix27
-rw-r--r--hosts/poweredge/nvidia.nix29
-rw-r--r--hosts/poweredge/resources/secrets/ddns-updater-config.yaml16
-rw-r--r--hosts/poweredge/resources/secrets/grafana.yaml16
-rw-r--r--hosts/poweredge/resources/secrets/mailer-pass.yaml16
-rw-r--r--hosts/poweredge/resources/secrets/router.yaml17
-rw-r--r--hosts/poweredge/resources/secrets/slskd.yaml16
-rw-r--r--hosts/poweredge/resources/secrets/vpn-router.yaml17
-rw-r--r--hosts/poweredge/router-hosts.nix48
-rw-r--r--hosts/poweredge/slskd.nix91
-rw-r--r--hosts/poweredge/transmission.nix75
-rw-r--r--hosts/poweredge/vpn-router.nix121
-rw-r--r--hosts/sweetiepc/configuration.nix51
-rw-r--r--hosts/sweetiepc/hardware-configuration.nix38
-rw-r--r--hosts/sweetiepc/resources/secrets/wg.yaml16
-rw-r--r--hosts/sweetiepc/wg.nix7
-rw-r--r--lib/default.nix3
-rw-r--r--lib/home-manager/default.nix3
-rw-r--r--lib/home-manager/mkprofile.nix9
-rw-r--r--lib/mkprofile.nix22
-rw-r--r--modules/home/alacritty.nix67
-rw-r--r--modules/home/chrome.nix28
-rw-r--r--modules/home/default.nix24
-rw-r--r--modules/home/firefox.nix80
-rw-r--r--modules/home/git.nix7
-rw-r--r--modules/home/gtk-bookmarks.nix17
-rw-r--r--modules/home/htop.nix38
-rw-r--r--modules/home/initial-home-setup.nix22
-rw-r--r--modules/home/pcmanfm.nix6
-rw-r--r--modules/home/resources/activation-scripts/clone-repos.sh24
-rw-r--r--modules/home/resources/firefox/uiCustomization.json1
-rw-r--r--modules/home/resources/firefox/userChrome.css193
-rw-r--r--modules/home/theme.nix74
-rw-r--r--modules/home/wallpapers.nix14
-rw-r--r--modules/hosts/T430/configuration.nix18
-rw-r--r--modules/hosts/T430/home.nix6
-rw-r--r--modules/hosts/T495/configuration.nix41
-rw-r--r--modules/hosts/T495/games.nix7
-rw-r--r--modules/hosts/T495/home.nix13
-rw-r--r--modules/hosts/T495/input-leap.nix11
-rw-r--r--modules/hosts/T495/resources/input-leap/input-leap.conf12
-rw-r--r--modules/hosts/T495/resources/secrets/wg0.yaml21
-rw-r--r--modules/hosts/hp-envy-office/configuration.nix39
-rw-r--r--modules/hosts/hp-envy-office/home.nix12
-rw-r--r--modules/hosts/libreX60/configuration.nix14
-rw-r--r--modules/hosts/libreX60/home.nix8
-rw-r--r--modules/hosts/optiplex/configuration.nix50
-rw-r--r--modules/hosts/optiplex/home.nix7
-rw-r--r--modules/root/autologin.nix13
-rw-r--r--modules/root/bluetooth.nix10
-rw-r--r--modules/root/bootloader.nix43
-rw-r--r--modules/root/default.nix50
-rw-r--r--modules/root/doas.nix19
-rw-r--r--modules/root/fonts.nix16
-rw-r--r--modules/root/home-manager.nix11
-rw-r--r--modules/root/hosts.nix15
-rw-r--r--modules/root/localization.nix5
-rw-r--r--modules/root/nas.nix36
-rw-r--r--modules/root/normaluser.nix12
-rw-r--r--modules/root/pipewire.nix12
-rw-r--r--modules/root/powerkeys.nix7
-rw-r--r--modules/root/resources/secrets/secrets.yaml22
-rw-r--r--modules/root/resources/x11/xinit-startx-xdg.patch14
-rw-r--r--modules/root/software/awesome.nix20
-rw-r--r--modules/root/software/default.nix34
l---------modules/root/software/derivations1
-rw-r--r--modules/root/software/desktop.nix79
-rw-r--r--modules/root/software/development.nix18
-rw-r--r--modules/root/software/docker.nix21
-rw-r--r--modules/root/software/system.nix13
-rw-r--r--modules/root/software/virtualisation.nix10
-rw-r--r--modules/root/ssh.nix8
-rw-r--r--modules/root/tlp.nix9
-rw-r--r--modules/root/wifi.nix18
-rw-r--r--modules/root/x11.nix30
-rw-r--r--modules/root/zsh.nix10
-rw-r--r--nixos/bootloader.nix60
-rw-r--r--nixos/decklink.nix21
-rw-r--r--nixos/default.nix24
-rw-r--r--nixos/geoclue.nix14
-rw-r--r--nixos/hosts.nix4
-rw-r--r--nixos/net-iface-labels.nix28
-rw-r--r--nixos/nix.nix (renamed from modules/root/nix.nix)0
-rw-r--r--nixos/polkit.nix48
-rw-r--r--nixos/powerkeys.nix14
-rw-r--r--nixos/programs/awesome.nix23
-rw-r--r--nixos/programs/ddcutil.nix12
-rw-r--r--nixos/resources/polkit-1/rules.d/0-wheel-no-pass.rules5
-rw-r--r--nixos/resources/polkit-1/rules.d/10-reboot-poweroff-users.rules17
-rw-r--r--nixos/secrets.nix (renamed from modules/root/secrets.nix)18
-rw-r--r--nixos/services/fileshares.nix296
-rw-r--r--nixos/services/mailer.nix67
-rw-r--r--nixos/services/router/default.nix8
-rw-r--r--nixos/services/router/dns-dhcp.nix306
-rw-r--r--nixos/services/router/hairpinning.nix47
-rw-r--r--nixos/services/router/routing.nix39
-rw-r--r--nixos/services/router/unbound-blocklist.nix82
-rw-r--r--nixos/services/zfs/zed-mailer.nix20
-rw-r--r--nixos/suspend.nix21
-rw-r--r--nixos/wireless.nix22
-rw-r--r--nixos/zshenv.nix24
-rw-r--r--pkgs/crazydiskinfo/default.nix41
-rw-r--r--pkgs/default.nix57
-rw-r--r--pkgs/immich-frame/default.nix46
-rw-r--r--pkgs/lowbat/default.nix28
-rw-r--r--pkgs/st/overrides.nix19
-rw-r--r--pkgs/unclutter-desktop-entry/default.nix14
-rw-r--r--pkgs/vimPlugins/overrides.nix83
-rw-r--r--pkgs/xerox-workcentre-7800-series-driver/default.nix86
-rw-r--r--pkgs/xorg/overrides.nix18
-rw-r--r--poweredge-pro outline58
-rwxr-xr-xrebuild10
-rw-r--r--todo27
-rw-r--r--users/default-home.nix5
-rw-r--r--users/default.nix5
-rw-r--r--users/timmy/default.nix87
-rw-r--r--users/timmy/home.nix109
-rw-r--r--users/timmy/hosts.nix8
-rw-r--r--users/timmy/localization.nix14
-rw-r--r--users/timmy/nas.nix36
-rw-r--r--users/timmy/printing.nix (renamed from modules/root/printing.nix)32
-rw-r--r--users/timmy/repos.nix48
-rw-r--r--users/timmy/resources/secrets/hashed-root-password.yaml52
-rw-r--r--users/timmy/resources/secrets/wpa_supplicant-conf.yaml16
-rw-r--r--users/timmy/user.nix22
-rw-r--r--users/timmy/wifi.nix17
250 files changed, 7472 insertions, 1777 deletions
diff --git a/.sops.yaml b/.sops.yaml
index a49783e..45e3648 100644
--- a/.sops.yaml
+++ b/.sops.yaml
@@ -1,7 +1,60 @@
keys:
- - &SSHDerived age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
+ - &general age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
+ - &flex-wg-router age1f0tmpy2nam58skmznjyqd3zf54rxtfrk6fda0vlpq9y3yg6wac7sjf0vja
+ - &poweredge age1zfvmt2avdlfz0fvchczplc84u7m8vqausm7zytl9s4x9m9yax4cqy30zpz
+ - &poweredge-pro age1q8l3g3t6qjhsmz0gju0n535pz45d2c9crla8jcd5ftjlqe4fs3eqfqay0k
+ - &sweetiepc age1fl4rk54n2xv4vssjkw4nywy93s4yqv69uzq2f64zuwd8fjq5u4cq9wmmsw
creation_rules:
- - path_regex: secrets/.*.yaml$
+ - path_regex: users/timmy/resources/secrets/hashed-root-password.yaml
key_groups:
- age:
- - *SSHDerived
+ - *general
+ - *flex-wg-router
+ - *poweredge
+ - *poweredge-pro
+ - *sweetiepc
+
+ - path_regex: users/timmy/resources/secrets/wpa_supplicant-conf.yaml
+ key_groups:
+ - age:
+ - *general
+
+ - path_regex: T495/resources/secrets/.*
+ key_groups:
+ - age:
+ - *general
+
+ - path_regex: X230/resources/secrets/.*
+ key_groups:
+ - age:
+ - *general
+
+ - path_regex: hp-envy-office/resources/secrets/.*
+ key_groups:
+ - age:
+ - *general
+
+ - path_regex: flex-wg-router/resources/secrets/.*
+ key_groups:
+ - age:
+ - *flex-wg-router
+
+ - path_regex: poweredge/resources/secrets/.*
+ key_groups:
+ - age:
+ - *poweredge
+
+ - path_regex: poweredge-pro/resources/secrets/.*
+ key_groups:
+ - age:
+ - *poweredge-pro
+
+ - path_regex: sweetiepc/resources/secrets/.*
+ key_groups:
+ - age:
+ - *sweetiepc
+
+ - path_regex: T430/resources/secrets/.*
+ key_groups:
+ - age:
+ - *general
diff --git a/archetypes/collections/bluetooth.nix b/archetypes/collections/bluetooth.nix
new file mode 100644
index 0000000..749a9f1
--- /dev/null
+++ b/archetypes/collections/bluetooth.nix
@@ -0,0 +1,12 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.bluetooth;
+in {
+ options._archetypes.collections.bluetooth = {
+ enable = lib.mkEnableOption "enables bluetooth and blueman";
+ };
+
+ config = lib.mkIf cfg.enable {
+ hardware.bluetooth.enable = true;
+ services.blueman.enable = config._archetypes.collections.desktop.utilities.enable; # FIXME
+ };
+}
diff --git a/archetypes/collections/desktop/cad.nix b/archetypes/collections/desktop/cad.nix
new file mode 100644
index 0000000..177228b
--- /dev/null
+++ b/archetypes/collections/desktop/cad.nix
@@ -0,0 +1,21 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.cad;
+in {
+ options._archetypes.collections.desktop.cad = {
+ enable = lib.mkEnableOption "install cad and 3d printing software";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ blender
+ freecad
+ orca-slicer
+ ];
+ # TODO remove once #467783 is resolved
+ environment.sessionVariables = {
+ # Make GTK3 file-chooser settings discoverable
+ # per https://github.com/NixOS/nixpkgs/issues/467783#issuecomment-3648708206
+ GSETTINGS_SCHEMA_DIR ="${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}/glib-2.0/schemas";
+ };
+ };
+}
diff --git a/archetypes/collections/desktop/chromium.nix b/archetypes/collections/desktop/chromium.nix
new file mode 100644
index 0000000..b4638f0
--- /dev/null
+++ b/archetypes/collections/desktop/chromium.nix
@@ -0,0 +1,18 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.chromium;
+in {
+ options._archetypes.collections.desktop.chromium = {
+ enable = lib.mkEnableOption "install chromium browser";
+ package = lib.mkOption {
+ type = lib.types.package;
+ default = pkgs.ungoogled-chromium;
+ description = "chromium package to install";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = [
+ cfg.package
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/crypto.nix b/archetypes/collections/desktop/crypto.nix
new file mode 100644
index 0000000..bfb9186
--- /dev/null
+++ b/archetypes/collections/desktop/crypto.nix
@@ -0,0 +1,13 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.crypto;
+in {
+ options._archetypes.collections.desktop.crypto = {
+ enable = lib.mkEnableOption "install crypto wallets";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ unstable.sparrow
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/default.nix b/archetypes/collections/desktop/default.nix
new file mode 100644
index 0000000..6ac79dd
--- /dev/null
+++ b/archetypes/collections/desktop/default.nix
@@ -0,0 +1,17 @@
+{
+ imports = [
+ ./cad.nix
+ ./chromium.nix
+ ./crypto.nix
+ ./extra.nix
+ ./firefox.nix
+ ./graphics.nix
+ ./office.nix
+ ./pipewire.nix
+ ./printing.nix
+ ./thumbnailers.nix
+ ./utilities.nix
+ ./video.nix
+ ./xserver.nix
+ ];
+}
diff --git a/archetypes/collections/desktop/extra.nix b/archetypes/collections/desktop/extra.nix
new file mode 100644
index 0000000..5cf4221
--- /dev/null
+++ b/archetypes/collections/desktop/extra.nix
@@ -0,0 +1,16 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.extraUtilities;
+in {
+ options._archetypes.collections.desktop.extraUtilities = {
+ enable = lib.mkEnableOption "install extra desktop utilities";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ jellyfin-mpv-shim
+ qbittorrent
+ remmina
+ sent
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/firefox.nix b/archetypes/collections/desktop/firefox.nix
new file mode 100644
index 0000000..02656f6
--- /dev/null
+++ b/archetypes/collections/desktop/firefox.nix
@@ -0,0 +1,12 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.firefox;
+in {
+ options._archetypes.collections.desktop.firefox = {
+ enable = lib.mkEnableOption "install firefox";
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.firefox.enable = true;
+ };
+}
+
diff --git a/archetypes/collections/desktop/graphics.nix b/archetypes/collections/desktop/graphics.nix
new file mode 100644
index 0000000..f4242d1
--- /dev/null
+++ b/archetypes/collections/desktop/graphics.nix
@@ -0,0 +1,16 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.graphics;
+in {
+ options._archetypes.collections.desktop.graphics = {
+ enable = lib.mkEnableOption "install graphic design software";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ blender
+ geeqie
+ gimp3
+ inkscape
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/office.nix b/archetypes/collections/desktop/office.nix
new file mode 100644
index 0000000..23e6862
--- /dev/null
+++ b/archetypes/collections/desktop/office.nix
@@ -0,0 +1,18 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.office;
+in {
+ options._archetypes.collections.desktop.office = {
+ enable = lib.mkEnableOption "install office software";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ hunspell # Spell checking in libreoffice
+ hunspellDicts.en_US
+ kdePackages.okular
+ libreoffice
+ pdfchain
+ thunderbird
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/pipewire.nix b/archetypes/collections/desktop/pipewire.nix
new file mode 100644
index 0000000..d80ac90
--- /dev/null
+++ b/archetypes/collections/desktop/pipewire.nix
@@ -0,0 +1,14 @@
+{ lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.pipewire;
+in {
+ options._archetypes.collections.desktop.pipewire = {
+ enable = lib.mkEnableOption "enables pipewire";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services.pipewire = {
+ enable = true;
+ pulse.enable = true;
+ };
+ };
+}
diff --git a/archetypes/collections/desktop/printing.nix b/archetypes/collections/desktop/printing.nix
new file mode 100644
index 0000000..ed31048
--- /dev/null
+++ b/archetypes/collections/desktop/printing.nix
@@ -0,0 +1,17 @@
+{ lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.printing;
+in {
+ options._archetypes.collections.desktop.printing = {
+ enable = lib.mkEnableOption "enables printing and avahi service";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services.printing.enable = true;
+
+ services.avahi = {
+ enable = true;
+ nssmdns4 = true;
+ openFirewall = true;
+ };
+ };
+}
diff --git a/archetypes/collections/desktop/thumbnailers.nix b/archetypes/collections/desktop/thumbnailers.nix
new file mode 100644
index 0000000..05731a2
--- /dev/null
+++ b/archetypes/collections/desktop/thumbnailers.nix
@@ -0,0 +1,18 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.thumbnailers;
+in {
+ options._archetypes.collections.desktop.thumbnailers = {
+ enable = lib.mkEnableOption "install thumbnailers for graphical file managers";
+ };
+
+ config = lib.mkIf cfg.enable {
+ # https://wiki.nixos.org/wiki/Thumbnails
+ # Thumbnailers created in /run/current-system/sw/share/thumbnailers
+ environment.systemPackages = with pkgs; [
+ ffmpegthumbnailer # Video
+ gdk-pixbuf # Images
+ libheif libheif.out # HEIF images
+ nufraw-thumbnailer # RAW images
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/utilities.nix b/archetypes/collections/desktop/utilities.nix
new file mode 100644
index 0000000..479145b
--- /dev/null
+++ b/archetypes/collections/desktop/utilities.nix
@@ -0,0 +1,32 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.utilities;
+in {
+ options._archetypes.collections.desktop.utilities = {
+ enable = lib.mkEnableOption "install basic desktop utilities";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ arandr
+ dex # Execute .desktop files
+ dmenu
+ gammastep
+ libnotify
+ lowbat
+ mpv
+ nsxiv
+ pavolctld
+ pavucontrol
+ pcmanfm
+ qdirstat
+ qdiskinfo
+ scrot
+ st
+ wpa_supplicant_gui
+ zathura
+ ];
+
+ programs.localsend.enable = true; # Installs & opens firewall
+ services.gvfs.enable = true; # GVfs allows for mounting drives in a graphical file manager
+ };
+}
diff --git a/archetypes/collections/desktop/video.nix b/archetypes/collections/desktop/video.nix
new file mode 100644
index 0000000..cce6516
--- /dev/null
+++ b/archetypes/collections/desktop/video.nix
@@ -0,0 +1,17 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.video;
+in {
+ options._archetypes.collections.desktop.video = {
+ enable = lib.mkEnableOption "install video capture and editing software";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ dvgrab
+ ffmpeg
+ mpv
+ obs-studio
+ vlc
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/xserver.nix b/archetypes/collections/desktop/xserver.nix
new file mode 100644
index 0000000..9d62048
--- /dev/null
+++ b/archetypes/collections/desktop/xserver.nix
@@ -0,0 +1,34 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.xserver;
+in {
+ options._archetypes.collections.desktop.xserver = {
+ enable = lib.mkEnableOption "installs xserver";
+ utilities.enable = lib.mkEnableOption "installs basic xserver utilities";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services = {
+ xserver = {
+ enable = true;
+ displayManager.startx.enable = true;
+ enableTearFree = true;
+ };
+ libinput.enable = true; # Enable touchpad support
+ };
+
+ # Install basic X utilities
+ environment.systemPackages = with pkgs; lib.optionals cfg.utilities.enable [
+ setxkbmap
+ unclutter-desktop-entry
+ unclutter-xfixes
+ xcape
+ xclip
+ xdotool
+ xinput
+ xkill
+ xrandr
+ xset
+ xwallpaper
+ ];
+ };
+}
diff --git a/archetypes/collections/development/default.nix b/archetypes/collections/development/default.nix
new file mode 100644
index 0000000..87fe2d2
--- /dev/null
+++ b/archetypes/collections/development/default.nix
@@ -0,0 +1,45 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.development;
+ hugoFirewallPort = 1313;
+in {
+ imports = [
+ ./docker.nix
+ ];
+
+ options._archetypes.collections.development = {
+ utilities.enable = lib.mkEnableOption "install basic dev utilities";
+ android.enable = lib.mkEnableOption "install android dev tools";
+ c.enable = lib.mkEnableOption "install c dev tools";
+ lua.enable = lib.mkEnableOption "install lua dev tools";
+ web = {
+ hugo = {
+ enable = lib.mkEnableOption "install hugo";
+ openFirewall = lib.mkEnableOption "open the port ${hugoFirewallPort} for viewing content from hugo serve on other devices";
+ };
+ node.enable = lib.mkEnableOption "install node";
+ };
+ };
+
+ config = {
+ environment.systemPackages = with pkgs; [
+ git
+ python3
+ ] ++ lib.optionals cfg.android.enable [
+ #adb-sync
+ android-tools
+ ] ++ lib.optionals cfg.c.enable [
+ gcc
+ git
+ gnumake
+ pkg-config
+ ] ++ lib.optionals cfg.lua.enable [
+ lua
+ ] ++ lib.optionals cfg.web.hugo.enable [
+ hugo
+ ] ++ lib.optionals cfg.web.node.enable [
+ nodejs
+ ];
+
+ networking.firewall.allowedTCPPorts = lib.mkIf cfg.web.hugo.openFirewall [ hugoFirewallPort ];
+ };
+}
diff --git a/archetypes/collections/development/docker.nix b/archetypes/collections/development/docker.nix
new file mode 100644
index 0000000..0c9fce4
--- /dev/null
+++ b/archetypes/collections/development/docker.nix
@@ -0,0 +1,15 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.development.docker;
+in {
+ options._archetypes.collections.development.docker = {
+ enable = lib.mkEnableOption "enables docker";
+ };
+
+ config = lib.mkIf cfg.enable {
+ virtualisation.docker.enable = true;
+
+ environment.systemPackages = with pkgs; [
+ docker-compose
+ ];
+ };
+}
diff --git a/modules/root/software/ddcutil.nix b/archetypes/collections/filesystems.nix
index 93e0af5..00ab409 100644
--- a/modules/root/software/ddcutil.nix
+++ b/archetypes/collections/filesystems.nix
@@ -1,6 +1,7 @@
{ pkgs, ... }: {
- hardware.i2c.enable = true;
environment.systemPackages = with pkgs; [
- ddcutil
+ cryptsetup
+ exfat
+ ntfs3g
];
}
diff --git a/archetypes/collections/fonts.nix b/archetypes/collections/fonts.nix
new file mode 100644
index 0000000..136e31b
--- /dev/null
+++ b/archetypes/collections/fonts.nix
@@ -0,0 +1,16 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.fonts;
+in {
+ options._archetypes.collections.fonts = {
+ enable = lib.mkEnableOption "enables fonts";
+ };
+
+ config = lib.mkIf cfg.enable {
+ fonts.packages = with pkgs; [
+ commit-mono
+ inter
+ nerd-fonts.jetbrains-mono
+ tamzen
+ ];
+ };
+}
diff --git a/archetypes/collections/music.nix b/archetypes/collections/music.nix
new file mode 100644
index 0000000..6302d68
--- /dev/null
+++ b/archetypes/collections/music.nix
@@ -0,0 +1,30 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.music;
+ beetsWithPlugins = pkgs.python3Packages.beets.override {
+ pluginOverrides = {
+ alternatives = {
+ enable = true;
+ propagatedBuildInputs = [ pkgs.python3Packages.beets-alternatives ];
+ };
+ };
+ };
+in {
+ options._archetypes.collections.music = {
+ beets.enable = lib.mkEnableOption "enables beets";
+ cd-tools.enable = lib.mkEnableOption "enables tools for burning, ripping, and converting cds";
+ };
+
+ config = {
+ environment.systemPackages = with pkgs; lib.optionals cfg.beets.enable [
+ beetsWithPlugins
+ ] ++ lib.optionals cfg.cd-tools.enable [
+ abcde
+ cdparanoia
+ cdrdao
+ cuetools
+ flac
+ shntool
+ whipper
+ ];
+ };
+}
diff --git a/archetypes/collections/neovim.nix b/archetypes/collections/neovim.nix
new file mode 100644
index 0000000..2040d77
--- /dev/null
+++ b/archetypes/collections/neovim.nix
@@ -0,0 +1,18 @@
+{ lib, pkgs, ... }: let
+ cfg.neovimPackage = pkgs.unstable.neovim;
+
+ # Neovim package that includes aliases vi(m) -> nvim
+ neovim-aliases = pkgs.symlinkJoin {
+ name = "neovim-aliases";
+ paths = [ cfg.neovimPackage ];
+ postBuild = ''
+ ln -sf $out/bin/nvim $out/bin/vi
+ ln -sf $out/bin/nvim $out/bin/vim
+ '';
+ };
+in {
+ # NOTE: Don't use programs.neovim since that will build neovim from source
+ environment.systemPackages = with pkgs; [
+ neovim-aliases
+ ];
+}
diff --git a/archetypes/collections/nvidia.nix b/archetypes/collections/nvidia.nix
new file mode 100644
index 0000000..ce22e8b
--- /dev/null
+++ b/archetypes/collections/nvidia.nix
@@ -0,0 +1,14 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.nvidia;
+in {
+ options._archetypes.collections.nvidia = {
+ enable = lib.mkEnableOption "enables nvidia debugging packages, etc.";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ config.hardware.nvidia.package # nvidia-smi
+ nvtopPackages.nvidia
+ ];
+ };
+}
diff --git a/modules/root/software/utilities.nix b/archetypes/collections/utilities.nix
index dabf163..fa797e8 100644
--- a/modules/root/software/utilities.nix
+++ b/archetypes/collections/utilities.nix
@@ -1,32 +1,46 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
+ R
+ brightnessctl
+ dash # TODO should be default /bin/sh
+ dnsutils
+ duf
entr
fastfetch
ffmpeg
htop
+ iotop
jq
- light
+ killall
lm_sensors
+ lsof
mediainfo
- neovim
+ ncdu
nmap
openssl
p7zip
+ pciutils
powertop
+ progress
pv
rsync
screen
smartmontools
sslscan
+ strace
stress
+ sysstat
+ tcpdump
testdisk
tmux
uhubctl
+ usbutils
+ vimv-rs
wget
wireguard-tools
- xxHash
+ xxhash
yt-dlp
- (callPackage ./derivations/lowbat {})
- (callPackage ./derivations/pavolctld {})
];
+
+ services.gpm.enable = true;
}
diff --git a/archetypes/collections/virtualization.nix b/archetypes/collections/virtualization.nix
new file mode 100644
index 0000000..b91f6e1
--- /dev/null
+++ b/archetypes/collections/virtualization.nix
@@ -0,0 +1,21 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.virtualization;
+in {
+ options._archetypes.collections.virtualization = {
+ enable = lib.mkEnableOption "enables virtualization and virt-manager";
+ };
+
+ config = lib.mkIf cfg.enable {
+ virtualisation = {
+ spiceUSBRedirection.enable = true;
+ libvirtd.enable = true;
+ # Enable efi support with ovmf firmware
+ libvirtd.qemu = {
+ package = pkgs.qemu_kvm;
+ runAsRoot = true;
+ swtpm.enable = true;
+ };
+ };
+ programs.virt-manager.enable = config._archetypes.collections.desktop.utilities.enable; # FIXME
+ };
+}
diff --git a/archetypes/default.nix b/archetypes/default.nix
new file mode 100644
index 0000000..0b0b838
--- /dev/null
+++ b/archetypes/default.nix
@@ -0,0 +1,16 @@
+{
+ imports = [
+ ./collections/bluetooth.nix
+ ./collections/desktop
+ ./collections/development
+ ./collections/filesystems.nix
+ ./collections/fonts.nix
+ ./collections/music.nix
+ ./collections/neovim.nix
+ ./collections/nvidia.nix
+ ./collections/utilities.nix
+ ./collections/virtualization.nix
+
+ ./profiles
+ ];
+}
diff --git a/archetypes/profiles/btrfs/default.nix b/archetypes/profiles/btrfs/default.nix
new file mode 100644
index 0000000..88fad38
--- /dev/null
+++ b/archetypes/profiles/btrfs/default.nix
@@ -0,0 +1,17 @@
+{ lib, pkgs, ... }: let
+ mkBtrfs = lib.mkOverride 820;
+
+ # https://wiki.nixos.org/wiki/Btrfs
+ nixosConfig = {
+ services.btrfs = {
+ autoScrub.enable = mkBtrfs true;
+ };
+
+ # Make docker work with btrfs
+ virtualisation.docker.storageDriver = mkBtrfs "btrfs";
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "btrfs" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/cuda/default.nix b/archetypes/profiles/cuda/default.nix
new file mode 100644
index 0000000..b57b854
--- /dev/null
+++ b/archetypes/profiles/cuda/default.nix
@@ -0,0 +1,26 @@
+{ lib, pkgs, ... }: let
+ mkCuda = lib.mkOverride 800;
+
+ nixosConfig = {
+ # Binary cache packages built with cudaSupport
+ nix.settings = {
+ substituters = mkCuda [ "https://cache.nixos-cuda.org" ];
+ trusted-public-keys = mkCuda [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
+ };
+
+ # Enable cudaSupport
+ nixpkgs.config.cudaSupport = mkCuda true;
+
+ _archetypes.collections = {
+ nvidia.enable = mkCuda true;
+ };
+
+ # Enable nvidia graphics
+ services.xserver.videoDrivers = mkCuda [ "nvidia" ]; # xserver.videoDrivers does not imply X
+ hardware.graphics.enable = mkCuda true;
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "cuda" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/default.nix b/archetypes/profiles/default.nix
new file mode 100644
index 0000000..1664484
--- /dev/null
+++ b/archetypes/profiles/default.nix
@@ -0,0 +1,11 @@
+{
+ imports = [
+ ./gnome # 700
+ ./cuda # 800
+ ./zfs # 810
+ ./btrfs # 820
+ ./pi # 900
+ ./headless # 910
+ ./desktop # 920
+ ];
+}
diff --git a/archetypes/profiles/desktop/default.nix b/archetypes/profiles/desktop/default.nix
new file mode 100644
index 0000000..2f71791
--- /dev/null
+++ b/archetypes/profiles/desktop/default.nix
@@ -0,0 +1,144 @@
+{ lib, pkgs, ... }: let
+ mkDesktop = lib.mkOverride 920;
+
+ nixosConfig = {
+ _archetypes.collections = {
+ desktop = {
+ firefox.enable = mkDesktop true;
+ pipewire.enable = mkDesktop true;
+ printing.enable = mkDesktop true;
+ thumbnailers.enable = mkDesktop true;
+ utilities.enable = mkDesktop true;
+ xserver = {
+ enable = mkDesktop true;
+ utilities.enable = mkDesktop true;
+ };
+ };
+ development = {
+ utilities.enable = mkDesktop true;
+ };
+ fonts.enable = mkDesktop true;
+ };
+
+ security = {
+ polkit = {
+ enable = mkDesktop true;
+ _gnome.enable = mkDesktop true;
+ _allowUserPowerControls = mkDesktop true;
+ };
+ };
+
+ programs = {
+ _ddcutil.enable = mkDesktop true;
+ };
+
+ services = {
+ _geoclue2.enable = mkDesktop true;
+ xserver = {
+ windowManager._awesome.enable = mkDesktop true;
+ enableTearFree = mkDesktop true;
+ };
+ logind._safePowerKey.enable = mkDesktop true;
+ openssh = {
+ enable = mkDesktop true;
+ settings.X11Forwarding = mkDesktop true;
+ };
+ tlp.enable = mkDesktop true;
+
+ # Ensure video group can change backlight
+ udev.extraRules = mkDesktop ''
+ SUBSYSTEM=="backlight", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
+ '';
+ };
+
+ # Disable ipv6 by default
+ networking.enableIPv6 = mkDesktop false;
+
+ # Install dconf. Home-manager will break without it if gtk theme is changed
+ environment.systemPackages = [ pkgs.dconf ];
+ };
+
+ homeConfig = {
+ gtk = {
+ enable = mkDesktop true;
+ _mintTheme.enable = mkDesktop true;
+ font.name = mkDesktop "sans-serif";
+ cursorTheme.name = mkDesktop "Adwaita";
+ };
+
+ qt._gtkPlatformTheme.enable = mkDesktop true;
+
+ fonts.fontconfig = {
+ enable = mkDesktop true;
+ defaultFonts = {
+ # These fonts are added above in fonts collection
+ sansSerif = mkDesktop [ "Inter" ];
+ monospace = mkDesktop [ "CommitMono" ];
+ };
+ configFile = {
+ tamzen-disable-anti-aliasing = {
+ enable = true;
+ source = ./resources/fontconfig/90-tamzen-disable-anti-aliasing.conf;
+ };
+ commit-mono-options = {
+ enable = true;
+ source = ./resources/fontconfig/90-commit-mono-options.conf;
+ };
+ };
+ };
+
+ programs = {
+ _pcmanfm.openAsRootOption.enable = mkDesktop true;
+ _st = {
+ enable = mkDesktop true;
+ font = {
+ name = mkDesktop "JetBrainsMonoNL Nerd Font Mono";
+ # Default attrs
+ attrs = {
+ size = 12;
+ antialias = true;
+ autohint = true;
+ };
+ };
+ };
+ firefox._configure = mkDesktop true;
+ htop._configure = mkDesktop true;
+ zathura = {
+ enable = mkDesktop true;
+ options = {
+ selection-clipboard = mkDesktop "clipboard"; # Copy highlighted text
+ };
+ };
+ };
+
+ services = {
+ _gammastep.enable = true;
+ #polkit-gnome.enable = mkDesktop true; # Doesn't work on X
+ };
+
+ xdg = {
+ autostart = {
+ enable = mkDesktop true;
+ entries = mkDesktop [
+ "${pkgs.gammastep}/share/applications/gammastep-indicator.desktop"
+ "${pkgs.unclutter-desktop-entry}/share/applications/unclutter.desktop"
+ ];
+ };
+ };
+
+ xdg.mimeApps._defaultCategoryApplications = {
+ enable = true;
+ categoryApplications = {
+ audio = [ "mpv" ];
+ directory = [ "pcmanfm" ];
+ email = [ "thunderbird" ];
+ image = [ "nsxiv" ];
+ pdf = [ "org.pwmt.zathura-pdf-mupdf" ];
+ text = [ "nvim" ];
+ video = [ "mpv" ];
+ };
+ };
+ };
+in {
+ imports = [ (lib._mkProfileArchetype "desktop" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/desktop/resources/fontconfig/90-commit-mono-options.conf b/archetypes/profiles/desktop/resources/fontconfig/90-commit-mono-options.conf
new file mode 100644
index 0000000..9c7373a
--- /dev/null
+++ b/archetypes/profiles/desktop/resources/fontconfig/90-commit-mono-options.conf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+
+<fontconfig>
+ <description>Enable opentype features for CommitMono to make it match better with Inter as its monospace counterpart</description>
+ <match target="font">
+ <test name="family" compare="eq" ignore-blanks="true">
+ <string>CommitMono</string>
+ </test>
+ <edit name="fontfeatures" mode="append">
+ <string>ss03 on</string> <!-- smart case -->
+ <string>ss04 on</string> <!-- symbol spacing -->
+ <string>cv02 on</string> <!-- alt g -->
+ <string>cv06 on</string> <!-- alt 6 & 9 -->
+ </edit>
+ </match>
+</fontconfig>
diff --git a/archetypes/profiles/desktop/resources/fontconfig/90-tamzen-disable-anti-aliasing.conf b/archetypes/profiles/desktop/resources/fontconfig/90-tamzen-disable-anti-aliasing.conf
new file mode 100644
index 0000000..5bf94d7
--- /dev/null
+++ b/archetypes/profiles/desktop/resources/fontconfig/90-tamzen-disable-anti-aliasing.conf
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+
+<fontconfig>
+ <description>Disable anti-aliasing for Tamzen since it is a bitmap font</description>
+ <match target="pattern">
+ <test name="family" compare="eq" qual="any">
+ <string>Tamzen</string>
+ </test>
+ <edit name="antialias" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+</fontconfig>
diff --git a/archetypes/profiles/gnome/default.nix b/archetypes/profiles/gnome/default.nix
new file mode 100644
index 0000000..afe53b4
--- /dev/null
+++ b/archetypes/profiles/gnome/default.nix
@@ -0,0 +1,39 @@
+{ lib, pkgs, ... }: let
+ mkGnome = lib.mkOverride 700;
+
+ nixosConfig = {
+ services.displayManager.gdm.enable = mkGnome true;
+ services.desktopManager.gnome.enable = mkGnome true;
+ services.tlp.enable = mkGnome false; # Conflicts with power-profiles-daemon
+
+ # Override gammastep so the indicator doesnt run on gnome
+ nixpkgs.overlays = with pkgs; [
+ (final: prev: {
+ gammastep = prev.gammastep.overrideAttrs (prev: {
+ postInstall = (prev.postInstall or "") + ''
+ sed -i '/^NotShowIn=/d' $out/share/applications/gammastep-indicator.desktop
+ echo "NotShowIn=GNOME;" >> $out/share/applications/gammastep-indicator.desktop
+ '';
+ });
+ })
+ ];
+ };
+
+ homeConfig = {
+ dconf.settings = {
+ # Faster repeated keys and less delay before repeating
+ # Gnome (wayland) eq. to `xset r rate 250 50`
+ "org/gnome/desktop/peripherals/keyboard" = {
+ repeat = true;
+ delay = 250;
+ repeat-interval = 20; # 20 repeats per second = 50Hz
+ };
+ # Remap caps key to escape
+ "org/gnome/desktop/input-sources" = {
+ xkb-options = [ "caps:escape" ];
+ };
+ };
+ };
+in {
+ imports = [ (lib._mkProfileArchetype "gnome" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/headless/default.nix b/archetypes/profiles/headless/default.nix
new file mode 100644
index 0000000..5c9d938
--- /dev/null
+++ b/archetypes/profiles/headless/default.nix
@@ -0,0 +1,33 @@
+{ lib, ... }: let
+ mkHeadless = lib.mkOverride 910;
+
+ nixosConfig = {
+ _archetypes.collections = {
+ development = {
+ utilities.enable = mkHeadless true;
+ };
+ };
+
+ services = {
+ openssh.enable = mkHeadless true;
+ smartd.enable = mkHeadless true;
+ };
+
+ # Disable ipv6 by default
+ networking.enableIPv6 = mkHeadless false;
+ };
+
+ homeConfig = {
+ # Disable fontconfig features explicitly to avoid warnings
+ fonts.fontconfig = {
+ subpixelRendering = mkHeadless "none";
+ hinting = mkHeadless "none";
+ };
+
+ programs = {
+ htop._configure = mkHeadless true;
+ };
+ };
+in {
+ imports = [ (lib._mkProfileArchetype "headless" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/pi/default.nix b/archetypes/profiles/pi/default.nix
new file mode 100644
index 0000000..639111a
--- /dev/null
+++ b/archetypes/profiles/pi/default.nix
@@ -0,0 +1,30 @@
+{ lib, pkgs, ... }: let
+ mkPi = lib.mkOverride 900;
+
+ nixosConfig = {
+ boot.loader = {
+ # Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
+ grub.enable = false;
+ # Enables the generation of /boot/extlinux/extlinux.conf
+ generic-extlinux-compatible.enable = true;
+ };
+ };
+
+ homeConfig = {
+ # Use raspian logo in fastfetch
+ programs.fastfetch.settings = {
+ logo.source = mkPi "raspbian";
+ # Default options for the rest of this
+ # TODO figure out how to just override logo and keep defaults w/config file
+ modules = [
+ "title" "separator" "os" "host" "kernel" "uptime" "packages"
+ "shell" "display" "de" "wm" "wmtheme" "theme" "icons" "font"
+ "cursor" "terminal" "terminalfont" "cpu" "gpu" "memory" "swap"
+ "disk" "localip" "battery" "poweradapter" "locale" "break"
+ "colors"
+ ];
+ };
+ };
+in {
+ imports = [ (lib._mkProfileArchetype "pi" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/zfs/default.nix b/archetypes/profiles/zfs/default.nix
new file mode 100644
index 0000000..90ec5ee
--- /dev/null
+++ b/archetypes/profiles/zfs/default.nix
@@ -0,0 +1,33 @@
+{ lib, pkgs, ... }: let
+ mkZfs = lib.mkOverride 810;
+
+ # https://wiki.nixos.org/wiki/ZFS
+ nixosConfig = {
+ boot._loader = {
+ grub.zfsSupport = mkZfs true;
+ mode = mkZfs "efi";
+ };
+
+ boot.supportedFilesystems = [ "zfs" ];
+
+ services.zfs = {
+ trim.enable = mkZfs true;
+ autoSnapshot.enable = mkZfs true;
+ autoScrub.enable = mkZfs true;
+ };
+
+ # Use overlay2 driver for zfs to avoid creating unnecessary datasets
+ virtualisation.docker.storageDriver = mkZfs "overlay2";
+
+ # Ensure root pools are safely imported (default after 26.11)
+ # NOTE: If NixOS fails to boot because it cannot import the root pool,
+ # you should boot with the zfs_force=1 option as a kernel parameter
+ # (e.g. by manually editing the kernel params via your bootloader). You
+ # should only need to do this after unclean shutdowns.
+ boot.zfs.forceImportRoot = mkZfs false;
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "zfs" nixosConfig homeConfig) ];
+}
diff --git a/derivations/lowbat/default.nix b/derivations/lowbat/default.nix
deleted file mode 100644
index 02ff111..0000000
--- a/derivations/lowbat/default.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ pkgs ? import <nixpkgs> {} }:
-
-pkgs.stdenv.mkDerivation rec {
- pname = "lowbat";
- version = "1.2.1";
-
- src = pkgs.fetchzip {
- url = "https://git.tjkeller.xyz/${pname}/snapshot/${pname}-${version}.tar.xz";
- sha256 = "sha256-xsUHdmicHX/fQQgojVjWfzI82e4NezkmlACOpdPxLE0=";
- };
-
- nativeBuildInputs = [ pkgs.pkg-config ];
- buildInputs = [ pkgs.libnotify pkgs.glib ];
-
- buildPhase = ''
- make
- '';
-
- installPhase = ''
- mkdir -p $out/bin $out/share/man/man1
- cp lowbat $out/bin/
- cp lowbat.1 $out/share/man/man1/
- '';
-
- meta = with pkgs.lib; {
- description = "A minimal battery level monitor daemon, written in C";
- license = licenses.mit;
- maintainers = [ maintainers.tjkeller ];
- };
-}
diff --git a/derivations/pavolctld/default.nix b/derivations/pavolctld/default.nix
deleted file mode 100644
index c78e3fe..0000000
--- a/derivations/pavolctld/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ pkgs ? import <nixpkgs> {} }:
-
-pkgs.stdenv.mkDerivation rec {
- pname = "pavolctld";
- version = "1.0.0";
-
- src = pkgs.fetchzip {
- url = "https://git.tjkeller.xyz/${pname}/snapshot/${pname}-${version}.tar.xz";
- sha256 = "sha256-eJ5njP2wu2kxsNgDdULOaATJJarLh+LkM5M9+kujRt4=";
- };
-
- buildInputs = [ pkgs.libpulseaudio ];
-
- buildPhase = ''
- make
- '';
-
- installPhase = ''
- mkdir -p $out/bin $out/share/man/man1
- cp pavolctld $out/bin/
- cp pavolctld.1 $out/share/man/man1/
- '';
-
- meta = with pkgs.lib; {
- description = "A minimal PulseAudio volume control/monitoring daemon";
- license = licenses.mit;
- maintainers = [ maintainers.tjkeller ];
- };
-}
diff --git a/derivations/st/default.nix b/derivations/st/default.nix
deleted file mode 100644
index eb7c6bc..0000000
--- a/derivations/st/default.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- lib,
- stdenv,
- fetchzip,
- fontconfig,
- libX11,
- libXcursor,
- libXext,
- libXft,
- ncurses,
- pkg-config,
-}:
-
-stdenv.mkDerivation rec {
- pname = "st";
- version = "tj-0.9.2.2";
-
- src = fetchzip {
- url = "https://git.tjkeller.xyz/${pname}/snapshot/${pname}-${version}.tar.xz";
- sha256 = "sha256-p1u7TEeLeC5Kjvi8na4YhyQQ0qdPaUWZL6hq9O4HaKA=";
- };
-
- nativeBuildInputs = [
- pkg-config
- ];
- buildInputs = [
- fontconfig
- libX11
- libXcursor
- libXext
- libXft
- ncurses
- ];
-
- installPhase = ''
- runHook preInstall
-
- TERMINFO=$out/share/terminfo make install PREFIX=$out
-
- runHook postInstall
- '';
-
- meta = with lib; {
- homepage = "https://git.tjkeller.xyz/st";
- description = "My st with various patches";
- mainProgram = "st";
- license = licenses.mit;
- maintainers = [ maintainers.tjkeller ];
- };
-}
diff --git a/flake.lock b/flake.lock
index 696cf81..78569cc 100644
--- a/flake.lock
+++ b/flake.lock
@@ -3,18 +3,17 @@
"arkenfox": {
"inputs": {
"flake-compat": "flake-compat",
- "flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"pre-commit": "pre-commit"
},
"locked": {
- "lastModified": 1725263787,
- "narHash": "sha256-OSNjus8VSkLCSikN6Qeq+II1bwqTRJEwl6NJvFoQHoE=",
+ "lastModified": 1793139173,
+ "narHash": "sha256-Yrh8NwudRJ8ifo0cjD4irDxV4nJhb8FWpoGvsolYxPQ=",
"owner": "dwarfmaster",
"repo": "arkenfox-nixos",
- "rev": "72addd96455cce49c0c8524c53aecd02cf20adec",
+ "rev": "6bea7a66c6618022a3a48e6304dca124ed3c1a09",
"type": "github"
},
"original": {
@@ -23,75 +22,59 @@
"type": "github"
}
},
- "flake-compat": {
- "flake": false,
- "locked": {
- "lastModified": 1696426674,
- "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
- "owner": "edolstra",
- "repo": "flake-compat",
- "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
- "type": "github"
+ "embedtube": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
},
- "original": {
- "owner": "edolstra",
- "repo": "flake-compat",
- "type": "github"
- }
- },
- "flake-compat_2": {
- "flake": false,
"locked": {
- "lastModified": 1696426674,
- "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
- "owner": "edolstra",
- "repo": "flake-compat",
- "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
- "type": "github"
+ "lastModified": 1790115704,
+ "narHash": "sha256-HcUHd14yJAE2yBbZM/55OfrF2r4IMEWasZgPpQNbdMI=",
+ "ref": "refs/heads/master",
+ "rev": "d57c816092db4bdf7ee8db45778b7d7c85e86faa",
+ "revCount": 25,
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/embedtube"
},
"original": {
- "owner": "edolstra",
- "repo": "flake-compat",
- "type": "github"
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/embedtube"
}
},
- "flake-utils": {
+ "ff-userchrome": {
"inputs": {
- "systems": "systems"
+ "nixpkgs": [
+ "nixpkgs"
+ ]
},
"locked": {
- "lastModified": 1710146030,
- "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
- "type": "github"
+ "lastModified": 1785605892,
+ "narHash": "sha256-/2Ov0VsC5Ri2sK4HDrYDzpSME96z1E/mROfevcMe2kQ=",
+ "ref": "refs/heads/master",
+ "rev": "106c1b7c7ae2119cf8ab10d87af6e4ca5a21f2e5",
+ "revCount": 9,
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/firefox-chrome"
},
"original": {
- "owner": "numtide",
- "repo": "flake-utils",
- "type": "github"
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/firefox-chrome"
}
},
- "gitignore": {
- "inputs": {
- "nixpkgs": [
- "arkenfox",
- "pre-commit",
- "nixpkgs"
- ]
- },
+ "flake-compat": {
+ "flake": false,
"locked": {
- "lastModified": 1709087332,
- "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
- "owner": "hercules-ci",
- "repo": "gitignore.nix",
- "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
+ "lastModified": 1767039857,
+ "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
- "owner": "hercules-ci",
- "repo": "gitignore.nix",
+ "owner": "edolstra",
+ "repo": "flake-compat",
"type": "github"
}
},
@@ -102,126 +85,164 @@
]
},
"locked": {
- "lastModified": 1733951536,
- "narHash": "sha256-Zb5ZCa7Xj+0gy5XVXINTSr71fCfAv+IKtmIXNrykT54=",
+ "lastModified": 1792818383,
+ "narHash": "sha256-199i7ubVSXTMl+0AAlL7cVCXSjcI+jWByMcimYjeMX0=",
"owner": "nix-community",
"repo": "home-manager",
- "rev": "1318c3f3b068cdcea922fa7c1a0a1f0c96c22f5f",
+ "rev": "24f2190587513b9c2f73db112a17844ae912d965",
"type": "github"
},
"original": {
"owner": "nix-community",
- "ref": "release-24.11",
+ "ref": "release-26.05",
"repo": "home-manager",
"type": "github"
}
},
- "nixpkgs": {
+ "neovim-vanilla": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
"locked": {
- "lastModified": 1719082008,
- "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "9693852a2070b398ee123a329e68f0dab5526681",
- "type": "github"
+ "lastModified": 1785545076,
+ "narHash": "sha256-lT+lWgPVjkzVumhy9eS4dJULIf/zuOlyQySzj3DVSfY=",
+ "ref": "refs/heads/master",
+ "rev": "07ad5b45941fa3e33a70270592815fa317a14c19",
+ "revCount": 3,
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/neovim-vanilla-wrapped"
},
"original": {
- "owner": "NixOS",
- "ref": "nixpkgs-unstable",
- "repo": "nixpkgs",
- "type": "github"
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/neovim-vanilla-wrapped"
}
},
- "nixpkgs-stable": {
+ "nixpkgs": {
"locked": {
- "lastModified": 1720386169,
- "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
- "owner": "NixOS",
+ "lastModified": 1793294725,
+ "narHash": "sha256-loLMnbbS4KhmG2ln9EY6f0YMNCA273Yx02oWYQ9IMeE=",
+ "owner": "nixos",
"repo": "nixpkgs",
- "rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
+ "rev": "6f06d204d8f2d8761d9da78778745974a3216381",
"type": "github"
},
"original": {
- "owner": "NixOS",
- "ref": "nixos-24.05",
+ "owner": "nixos",
+ "ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
},
- "nixpkgs-stable_2": {
+ "nixpkgs-unstable": {
"locked": {
- "lastModified": 1729357638,
- "narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=",
- "owner": "NixOS",
+ "lastModified": 1793110635,
+ "narHash": "sha256-dhoW6VgFWlaodSY5jrBn+CF2FLmaUvDVgM7+C7T2+NM=",
+ "owner": "nixos",
"repo": "nixpkgs",
- "rev": "bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22",
+ "rev": "31ecbaca1bdefa45dffc409f0250bd8039ea0010",
"type": "github"
},
"original": {
- "owner": "NixOS",
- "ref": "release-24.05",
+ "owner": "nixos",
+ "ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
- "nixpkgs_2": {
+ "open-bamboo": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
"locked": {
- "lastModified": 1734083684,
- "narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
- "owner": "nixos",
- "repo": "nixpkgs",
- "rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
- "type": "github"
+ "lastModified": 1783547778,
+ "narHash": "sha256-FfRX1zxgFeflmKYTBkB4yUgFR6dHyTq6PXCMz3AVU/A=",
+ "ref": "refs/heads/master",
+ "rev": "ec31c5ccdca65669d889261510d739d5302d48db",
+ "revCount": 4,
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/open-bamboo-network-plugin-flake"
},
"original": {
- "owner": "nixos",
- "ref": "nixos-24.11",
- "repo": "nixpkgs",
- "type": "github"
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/open-bamboo-network-plugin-flake"
}
},
"pre-commit": {
"inputs": {
- "flake-compat": "flake-compat_2",
- "gitignore": "gitignore",
- "nixpkgs": "nixpkgs",
- "nixpkgs-stable": "nixpkgs-stable"
+ "flake-compat": [
+ "arkenfox",
+ "flake-compat"
+ ],
+ "nixpkgs": [
+ "arkenfox",
+ "nixpkgs"
+ ]
},
"locked": {
- "lastModified": 1724857454,
- "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=",
+ "lastModified": 1791909798,
+ "narHash": "sha256-VAhpCOmrun/KXimYfR8NM88bciKCui7CqHHhThSzgag=",
"owner": "cachix",
- "repo": "pre-commit-hooks.nix",
- "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
+ "repo": "git-hooks.nix",
+ "rev": "1ba1dbfe28738c9a71c266be6efa5b89e75491a9",
"type": "github"
},
"original": {
"owner": "cachix",
- "repo": "pre-commit-hooks.nix",
+ "repo": "git-hooks.nix",
"type": "github"
}
},
+ "reposync": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1767033825,
+ "narHash": "sha256-z+V1Tc7+d73+vMh/M+kt2x3ctRzEqZvHxyIB1z/+2rs=",
+ "ref": "refs/heads/master",
+ "rev": "6fcb76423a96bca42520cf80b945a193d2a4c377",
+ "revCount": 6,
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/hm-reposync"
+ },
+ "original": {
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/hm-reposync"
+ }
+ },
"root": {
"inputs": {
"arkenfox": "arkenfox",
+ "embedtube": "embedtube",
+ "ff-userchrome": "ff-userchrome",
"home-manager": "home-manager",
- "nixpkgs": "nixpkgs_2",
- "sops-nix": "sops-nix"
+ "neovim-vanilla": "neovim-vanilla",
+ "nixpkgs": "nixpkgs",
+ "nixpkgs-unstable": "nixpkgs-unstable",
+ "open-bamboo": "open-bamboo",
+ "reposync": "reposync",
+ "sops-nix": "sops-nix",
+ "telemetry": "telemetry"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
- ],
- "nixpkgs-stable": "nixpkgs-stable_2"
+ ]
},
"locked": {
- "lastModified": 1729394972,
- "narHash": "sha256-fADlzOzcSaGsrO+THUZ8SgckMMc7bMQftztKFCLVcFI=",
+ "lastModified": 1793052255,
+ "narHash": "sha256-Y/JIHTnMlOabDfyaSBubWGLDIVGihLEUuoMhFvQKaDo=",
"owner": "Mic92",
"repo": "sops-nix",
- "rev": "c504fd7ac946d7a1b17944d73b261ca0a0b226a5",
+ "rev": "60182817ee048ac94b4c68ea76d5ef2e8aac730d",
"type": "github"
},
"original": {
@@ -230,19 +251,24 @@
"type": "github"
}
},
- "systems": {
+ "telemetry": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
"locked": {
- "lastModified": 1681028828,
- "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
- "owner": "nix-systems",
- "repo": "default",
- "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
- "type": "github"
+ "lastModified": 1788400906,
+ "narHash": "sha256-tApd9DEwqsgOVXQRQr+IqagrNbzWdo9XBj70lbFvJSU=",
+ "ref": "refs/heads/master",
+ "rev": "e88a880435ebdda6e50bf16a493abb85b4e80d15",
+ "revCount": 7,
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/telemetry-flake"
},
"original": {
- "owner": "nix-systems",
- "repo": "default",
- "type": "github"
+ "type": "git",
+ "url": "git://git.tjkeller.xyz/telemetry-flake"
}
}
},
diff --git a/flake.nix b/flake.nix
index 547d9db..11ed1ac 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,69 +2,108 @@ rec {
description = "TimmyOS System Config";
inputs = {
- nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
+ nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
- sops-nix = {
- url = "github:Mic92/sops-nix";
- inputs.nixpkgs.follows = "nixpkgs";
- };
-
- home-manager = {
- url = "github:nix-community/home-manager/release-24.11";
- inputs.nixpkgs.follows = "nixpkgs";
- };
-
- arkenfox = {
- url = "github:dwarfmaster/arkenfox-nixos";
- inputs.nixpkgs.follows = "nixpkgs";
- };
+ sops-nix = { url = "github:Mic92/sops-nix" ; inputs.nixpkgs.follows = "nixpkgs"; };
+ home-manager = { url = "github:nix-community/home-manager/release-26.05" ; inputs.nixpkgs.follows = "nixpkgs"; };
+ arkenfox = { url = "github:dwarfmaster/arkenfox-nixos" ; inputs.nixpkgs.follows = "nixpkgs"; };
+ reposync = { url = "git://git.tjkeller.xyz/hm-reposync" ; inputs.nixpkgs.follows = "nixpkgs"; };
+ open-bamboo = { url = "git://git.tjkeller.xyz/open-bamboo-network-plugin-flake" ; inputs.nixpkgs.follows = "nixpkgs"; };
+ neovim-vanilla = { url = "git://git.tjkeller.xyz/neovim-vanilla-wrapped" ; inputs.nixpkgs.follows = "nixpkgs"; };
+ ff-userchrome = { url = "git://git.tjkeller.xyz/firefox-chrome" ; inputs.nixpkgs.follows = "nixpkgs"; };
+ embedtube = { url = "git://git.tjkeller.xyz/embedtube" ; inputs.nixpkgs.follows = "nixpkgs"; };
+ telemetry = { url = "git://git.tjkeller.xyz/telemetry-flake" ; inputs.nixpkgs.follows = "nixpkgs"; };
};
- outputs = { nixpkgs, home-manager, arkenfox, ... }@inputs :
- let
- system = "x86_64-linux";
- pkgs = nixpkgs.legacyPackages.${system};
- userDetails = {
- username = "timmy";
- home.root = "/home/timmy";
- home.downloads = "/home/timmy/dls";
- home.documents = "/home/timmy/docs";
- home.pictures = "/home/timmy/pics";
- email = "tjkeller.xyz";
- fullname = "Tim Keller";
+ outputs = { nixpkgs, home-manager, ... }@inputs: let
+ extLib = nixpkgs.lib.extend (final: prev: import ./lib);
+ extLibHomeManagerStandalone = nixpkgs.lib.extend (final: prev: import ./lib/home-manager);
+ homeManagerModules = [
+ inputs.arkenfox.hmModules.arkenfox
+ inputs.reposync.hmModules.reposync
+ inputs.open-bamboo.hmModules.open-bamboo-networking
+ inputs.neovim-vanilla.hmModules.neovim-vanilla-wrapped
+ ./home-manager
+ ];
+ mkNixosConfiguration = system: hostname: nixpkgs.lib.nixosSystem {
+ inherit system;
+ specialArgs = {
+ inherit inputs;
+ inherit hostname;
+ lib = extLib;
};
- mkNixosConfiguration = hostname: nixpkgs.lib.nixosSystem {
- inherit system;
- specialArgs = {
- inherit inputs;
- inherit userDetails;
- };
- modules = [
- ./modules/hosts/${hostname}/configuration.nix
- ./modules/root
- home-manager.nixosModules.home-manager {
- home-manager = {
- backupFileExtension = "backup";
- useGlobalPkgs = true;
- useUserPackages = true;
- users.${userDetails.username} = import ./modules/home;
- extraSpecialArgs = {
- inherit userDetails;
- };
- sharedModules = [
- inputs.arkenfox.hmModules.arkenfox
- ./modules/hosts/${hostname}/home.nix
- ];
- };
- }
- ];
- };
- in {
- nixosConfigurations = {
- T430 = mkNixosConfiguration "T430";
- T495 = mkNixosConfiguration "T495";
- hp-envy-office = mkNixosConfiguration "hp-envy-office";
- optiplex = mkNixosConfiguration "optiplex";
+ modules = [
+ ./hosts/${hostname}/configuration.nix
+ ./hosts/${hostname}/hardware-configuration.nix
+ ./archetypes
+ ./nixos
+ ./pkgs
+ ./users
+ inputs.sops-nix.nixosModules.sops
+ home-manager.nixosModules.home-manager {
+ home-manager = {
+ backupFileExtension = "backup"; # In case file is overwritten
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ sharedModules = homeManagerModules;
+ extraSpecialArgs = { inherit inputs; };
+ };
+ }
+ ];
+ };
+ mkNixosConfigurations = hostsBySystem: builtins.listToAttrs (
+ builtins.concatMap (system:
+ map (host: {
+ name = host;
+ value = mkNixosConfiguration system host;
+ }) hostsBySystem.${system}
+ ) (builtins.attrNames hostsBySystem)
+ );
+ mkHomeConfiguration = user: system: hostname: home-manager.lib.homeManagerConfiguration {
+ pkgs = nixpkgs.legacyPackages.${system};
+ extraSpecialArgs = {
+ inherit inputs;
+ lib = extLibHomeManagerStandalone;
};
+ modules = homeManagerModules ++ [
+ ./hosts/${hostname}/home-${user}/configuration.nix
+ ./archetypes/profiles
+ ./pkgs
+ ./users/default-home.nix
+ ];
};
+ mkHomeConfigurations = hostsBySystem: builtins.listToAttrs (
+ builtins.concatMap (system:
+ map (host: {
+ name = host;
+ value = mkHomeConfiguration "timmy" system host; # TODO
+ }) hostsBySystem.${system}
+ ) (builtins.attrNames hostsBySystem)
+ );
+ in {
+ # Configured system hostnames go here under their respective system architecture
+ nixosConfigurations = mkNixosConfigurations {
+ x86_64-linux = [
+ "T430"
+ "X230"
+ "flex-wg-router"
+ "gnuslashprinter"
+ "libreX60"
+ "office-precision"
+ "optiplex"
+ "poweredge"
+ "poweredge-pro"
+ "sweetiepc"
+ ];
+ aarch64-linux = [
+ "piframe"
+ ];
+ };
+ homeConfigurations = mkHomeConfigurations {
+ x86_64-linux = [
+ "libreX60"
+ ];
+ };
+ };
}
diff --git a/home-manager/default.nix b/home-manager/default.nix
new file mode 100644
index 0000000..226552a
--- /dev/null
+++ b/home-manager/default.nix
@@ -0,0 +1,18 @@
+{
+ imports = [
+ ./firefox.nix
+ ./fontconfig.nix
+ ./gammastep.nix
+ ./home-cleanup.nix
+ ./htop.nix
+ ./mint-theme.nix
+ ./pcmanfm.nix
+ ./qt-gtk-theme.nix
+ ./theme-st.nix
+ ./wallpapers.nix
+ ./xdg-mime.nix
+ ];
+
+ # Let Home Manager install and manage itself.
+ programs.home-manager.enable = true;
+}
diff --git a/home-manager/firefox.nix b/home-manager/firefox.nix
new file mode 100644
index 0000000..a6cbd24
--- /dev/null
+++ b/home-manager/firefox.nix
@@ -0,0 +1,113 @@
+{ config, lib, pkgs, inputs, ... }: let
+ cfg = config.programs.firefox;
+ search = {
+ engines = {
+ "Timmy Search" = {
+ urls = [{
+ template = "https://search.tjkeller.xyz/search";
+ params = [ { name = "q"; value = "{searchTerms}"; } ];
+ }];
+ iconURI = "https://search.tjkeller.xyz/static/themes/simple/img/favicon.svg"; # TODO doesn't seem to work
+ };
+ "Nix Packages" = {
+ urls = [{
+ template = "https://search.nixos.org/packages";
+ params = [ { name = "query"; value = "{searchTerms}"; } ];
+ }];
+ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+ definedAliases = [ "@np" ];
+ };
+ "NixOS Options" = {
+ urls = [{
+ template = "https://search.nixos.org/options";
+ params = [ { name = "query"; value = "{searchTerms}"; } ];
+ }];
+ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+ definedAliases = [ "@no" ];
+ };
+ };
+ default = "Timmy Search";
+ privateDefault = "Timmy Search";
+ force = true; # Overwrite old
+ };
+ userChrome = inputs.ff-userchrome.userChrome;
+ uiCustomization = {
+ placements = {
+ nav-bar = [
+ "back-button"
+ "forward-button"
+ "stop-reload-button"
+ "vertical-spacer"
+ "home-button"
+ "urlbar-container"
+ "downloads-button"
+ "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" # Bitwarden
+ "unified-extensions-button"
+ ];
+ TabsToolbar = [ "tabbrowser-tabs" "new-tab-button" ];
+ # Ensure these extensions go to overflow menu instead of nav-bar
+ unified-extensions-area = [
+ "ublock0_raymondhill_net-browser-action"
+ "sponsorblocker_ajay_app-browser-action"
+ ];
+ };
+ currentVersion = 23; # Required
+ };
+ arkenfox = {
+ enable = true;
+ enableAllSections = true;
+ "0100"."0102"."browser.startup.page".value = 3; # 0=blank, 1=home, 2=last visited page, 3=resume previous session
+ "0100"."0103"."browser.startup.homepage".enable = false;
+ "0100"."0104"."browser.newtabpage.enabled".enable = false;
+ #"2800"."2811"."privacy.clearOnShutdown.history".enable = false;
+ };
+ settings = {
+ "browser.compactmode.show" = true;
+ "browser.uiCustomization.state" = builtins.toJSON uiCustomization; # Toolbar etc.
+ "browser.uidensity" = 1; # Compact
+ "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # userchrome
+
+ "app.normandy.first_run" = false;
+ "browser.aboutConfig.showWarning" = false; # arkenfox does
+ #"browser.download.dir" = userDetails.userDirs.downloads;
+ "browser.newtabpage.activity-stream.feeds.section.topstories" = false;
+ "browser.newtabpage.activity-stream.feeds.topsites" = false;
+ "browser.urlbar.suggest.topsites" = false;
+ "devtools.toolbox.host" = "window";
+ "dom.push.enabled" = false; #
+ "extensions.pocket.enabled" = false;
+ "general.smoothScroll" = false;
+ #"geo.provider.use_geoclue" = true;
+ };
+ workSettings = settings // {
+ "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; # Use builtin dark theme instead of system theme
+ };
+in {
+ options.programs.firefox = {
+ _configure = lib.mkEnableOption "configure firefox profiles";
+ };
+
+ config = lib.mkIf cfg._configure {
+ programs.firefox = {
+ enable = lib.mkDefault true;
+ arkenfox.enable = lib.mkDefault true;
+ profiles = {
+ Personal = {
+ id = 0;
+ isDefault = true;
+ inherit search;
+ inherit userChrome;
+ inherit arkenfox;
+ inherit settings;
+ };
+ Work = {
+ id = 1;
+ inherit search;
+ inherit userChrome;
+ inherit arkenfox;
+ settings = workSettings;
+ };
+ };
+ };
+ };
+}
diff --git a/home-manager/fontconfig.nix b/home-manager/fontconfig.nix
new file mode 100644
index 0000000..7c12b7e
--- /dev/null
+++ b/home-manager/fontconfig.nix
@@ -0,0 +1,11 @@
+{ lib, config, ... }: {
+ config = {
+ # Warn whenever subpixelRendering is not enabled
+ warnings = [
+ (lib.mkIf (config.fonts.fontconfig.subpixelRendering == null)
+ ''fonts.fontconfig.subpixelRendering is unset; this may result in suboptimal font rendering. Set this value to "none" to disable the feature explicitly.'')
+ (lib.mkIf (config.fonts.fontconfig.hinting == null)
+ ''fonts.fontconfig.hinting is unset; this may result in suboptimal font clarity. Set this value to "none" to disable the feature explicitly.'')
+ ];
+ };
+}
diff --git a/home-manager/gammastep.nix b/home-manager/gammastep.nix
new file mode 100644
index 0000000..f7ea3b3
--- /dev/null
+++ b/home-manager/gammastep.nix
@@ -0,0 +1,18 @@
+{ config, lib, ... }: let
+ cfg = config.services._gammastep;
+in {
+ options.services._gammastep = {
+ enable = lib.mkEnableOption "configure gammastep";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services.gammastep = {
+ enable = true;
+ provider = lib.mkDefault "geoclue2";
+ temperature = {
+ day = lib.mkDefault 6500; # gammastep default, the hm module defaults to 5500
+ night = lib.mkDefault 3600;
+ };
+ };
+ };
+}
diff --git a/home-manager/home-cleanup.nix b/home-manager/home-cleanup.nix
new file mode 100644
index 0000000..1f7c426
--- /dev/null
+++ b/home-manager/home-cleanup.nix
@@ -0,0 +1,21 @@
+{ config, lib, ... }: let
+ cacheHome = config.xdg.cacheHome;
+ configHome = config.xdg.configHome;
+ dataHome = config.xdg.dataHome;
+in {
+ # Gtk 2
+ # This file may be generated by home-manager, so this will need to be set
+ # so that it ends up in the correct location
+ gtk.gtk2.configLocation = "${configHome}/gtk-2.0/gtkrc";
+
+ # Npm
+ xdg.configFile.npmrc = {
+ enable = lib.mkDefault true;
+ text = builtins.replaceStrings ["\t"] [""] ''
+ prefix=${dataHome}/npm
+ cache=${cacheHome}/npm
+ init-module=${dataHome}/npm/npm-init.js
+ '';
+ target = "npm/npmrc";
+ };
+}
diff --git a/home-manager/htop.nix b/home-manager/htop.nix
new file mode 100644
index 0000000..36ccbac
--- /dev/null
+++ b/home-manager/htop.nix
@@ -0,0 +1,46 @@
+{ config, lib, ... }: let
+ cfg = config.programs.htop;
+in {
+ options.programs.htop = {
+ _configure = lib.mkEnableOption "apply sensible defaults to htop";
+ };
+
+ config = lib.mkIf cfg._configure {
+ programs.htop.enable = lib.mkDefault true;
+ programs.htop.settings = {
+ fields = with config.lib.htop.fields; [
+ PID
+ USER
+ 124 # EXE
+ PERCENT_CPU
+ PERCENT_MEM
+ STARTTIME
+ ELAPSED # time elapsed since process start
+ IO_READ_RATE
+ RBYTES # num read bytes
+ IO_WRITE_RATE
+ WBYTES # num written bytes
+ TIME
+ STIME # sys time
+ CSTIME # child sys time
+ NICE
+ STATE
+ PRIORITY
+ 125 # CWD
+ ];
+ } // (with config.lib.htop; leftMeters [
+ (bar "AllCPUs2")
+ (bar "CPU")
+ (bar "Memory")
+ (bar "DiskIO")
+ (bar "NetworkIO")
+ ]) // (with config.lib.htop; rightMeters [
+ (text "Hostname")
+ (text "Clock")
+ (text "Uptime")
+ (text "Battery")
+ (text "LoadAverage")
+ (text "Tasks")
+ ]);
+ };
+}
diff --git a/home-manager/mint-theme.nix b/home-manager/mint-theme.nix
new file mode 100644
index 0000000..a77be6a
--- /dev/null
+++ b/home-manager/mint-theme.nix
@@ -0,0 +1,43 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.gtk._mintTheme; # gtk.theme type is null or submodule under the hood so gtk.theme._mint, etc. can't be used
+ transformColorValue = color: dark:
+ "Mint-Y" + lib.optionalString dark "-Dark"
+ + lib.optionalString (color != "Green") ("-" + color)
+ ;
+in {
+ options.gtk._mintTheme = {
+ enable = lib.mkEnableOption "enables mint theme";
+ color = lib.mkOption {
+ type = lib.types.enum [
+ "Aqua" "Blue" "Green" "Grey" "Orange"
+ "Pink" "Purple" "Red" "Sand" "Teal"
+ ];
+ default = "Green";
+ description = "mint-y theme color";
+ };
+ dark = lib.mkEnableOption "whether to use dark variant of mint theme";
+ icons.color = lib.mkOption {
+ type = lib.types.enum [
+ "Aqua" "Blue" "Green" "Grey" "Orange" "Pink" "Purple" "Red"
+ "Sand" "Teal"
+ ];
+ default = "Aqua";
+ description = "mint-y icons color eg. 'Aqua' or 'Red'";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ gtk = {
+ enable = true;
+ theme = {
+ package = pkgs.mint-themes;
+ name = transformColorValue cfg.color cfg.dark;
+ };
+ iconTheme = {
+ package = pkgs.mint-y-icons;
+ name = transformColorValue cfg.icons.color false;
+ };
+ };
+ };
+}
diff --git a/home-manager/pcmanfm.nix b/home-manager/pcmanfm.nix
new file mode 100644
index 0000000..fc2737a
--- /dev/null
+++ b/home-manager/pcmanfm.nix
@@ -0,0 +1,14 @@
+{ config, lib, ... }: let
+ cfg = config.programs._pcmanfm.openAsRootOption;
+in {
+ options.programs._pcmanfm.openAsRootOption = {
+ enable = lib.mkEnableOption "enable 'open as root' option in pcmanfm right-click menu";
+ };
+
+ config = lib.mkIf cfg.enable {
+ home.file.pcmanfm-root = {
+ target = ".local/share/file-manager/actions/root.desktop";
+ source = ./resources/pcmanfm/root.desktop;
+ };
+ };
+}
diff --git a/home-manager/qt-gtk-theme.nix b/home-manager/qt-gtk-theme.nix
new file mode 100644
index 0000000..2e53ccc
--- /dev/null
+++ b/home-manager/qt-gtk-theme.nix
@@ -0,0 +1,15 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.qt._gtkPlatformTheme;
+in {
+ options.qt._gtkPlatformTheme = {
+ enable = lib.mkEnableOption "use gtk theme in qt";
+ };
+
+ config = lib.mkIf cfg.enable {
+ qt = {
+ enable = lib.mkDefault true;
+ platformTheme.name = "gtk3";
+ };
+ };
+}
diff --git a/modules/home/resources/pcmanfm/root.desktop b/home-manager/resources/pcmanfm/root.desktop
index 4b4d263..f5863e9 100644
--- a/modules/home/resources/pcmanfm/root.desktop
+++ b/home-manager/resources/pcmanfm/root.desktop
@@ -7,5 +7,5 @@ Icon=gtk-dialog-authentication
[X-Action-Profile profile-zero]
MimeTypes=inode/directory;
-Exec=/home/timmy/.local/bin/x11/xsudo /usr/bin/pcmanfm %u
+Exec=pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" XDG_DATA_DIRS="$XDG_DATA_DIRS" XDG_CONFIG_HOME="$XDG_CONFIG_HOME" pcmanfm %u
Name=Default profile
diff --git a/home-manager/resources/xdg-mime/audio b/home-manager/resources/xdg-mime/audio
new file mode 100644
index 0000000..fd00b26
--- /dev/null
+++ b/home-manager/resources/xdg-mime/audio
@@ -0,0 +1,65 @@
+application/x-cue
+application/x-extension-m4a
+application/x-ogm-audio
+application/x-shorten
+audio/3gpp
+audio/3gpp2
+audio/AMR
+audio/aac
+audio/ac3
+audio/aiff
+audio/amr-wb
+audio/dv
+audio/eac3
+audio/flac
+audio/m3u
+audio/m4a
+audio/mp1
+audio/mp2
+audio/mp3
+audio/mp4
+audio/mpeg
+audio/mpeg2
+audio/mpeg3
+audio/mpegurl
+audio/mpg
+audio/musepack
+audio/ogg
+audio/opus
+audio/rn-mpeg
+audio/scpls
+audio/vnd.dolby.heaac.1
+audio/vnd.dolby.heaac.2
+audio/vnd.dts
+audio/vnd.dts.hd
+audio/vnd.rn-realaudio
+audio/vorbis
+audio/wav
+audio/webm
+audio/x-aac
+audio/x-adpcm
+audio/x-aiff
+audio/x-ape
+audio/x-m4a
+audio/x-matroska
+audio/x-mp1
+audio/x-mp2
+audio/x-mp3
+audio/x-mpegurl
+audio/x-mpg
+audio/x-ms-asf
+audio/x-ms-wma
+audio/x-musepack
+audio/x-pls
+audio/x-pn-au
+audio/x-pn-realaudio
+audio/x-pn-wav
+audio/x-pn-windows-pcm
+audio/x-realaudio
+audio/x-scpls
+audio/x-shorten
+audio/x-tta
+audio/x-vorbis
+audio/x-vorbis+ogg
+audio/x-wav
+audio/x-wavpack
diff --git a/home-manager/resources/xdg-mime/directory b/home-manager/resources/xdg-mime/directory
new file mode 100644
index 0000000..4284766
--- /dev/null
+++ b/home-manager/resources/xdg-mime/directory
@@ -0,0 +1,2 @@
+inode/directory
+inode/mount-point
diff --git a/home-manager/resources/xdg-mime/email b/home-manager/resources/xdg-mime/email
new file mode 100644
index 0000000..db65256
--- /dev/null
+++ b/home-manager/resources/xdg-mime/email
@@ -0,0 +1,6 @@
+application/mbox
+application/vnd.ms-outlook
+message/rfc822
+text/calendar
+x-scheme-handler/mailto
+x-scheme-handler/mid
diff --git a/home-manager/resources/xdg-mime/image b/home-manager/resources/xdg-mime/image
new file mode 100644
index 0000000..1e2623b
--- /dev/null
+++ b/home-manager/resources/xdg-mime/image
@@ -0,0 +1,21 @@
+application/postscript
+image/avif
+image/bmp
+image/gif
+image/heic
+image/heif
+image/jp2
+image/jpeg
+image/jpg
+image/jxl
+image/png
+image/svg+xml
+image/svg+xml-compressed
+image/tiff
+image/webp
+image/x-bmp
+image/x-portable-anymap
+image/x-portable-bitmap
+image/x-portable-graymap
+image/x-tga
+image/x-xpixmap
diff --git a/home-manager/resources/xdg-mime/pdf b/home-manager/resources/xdg-mime/pdf
new file mode 100644
index 0000000..73bd5d0
--- /dev/null
+++ b/home-manager/resources/xdg-mime/pdf
@@ -0,0 +1,4 @@
+application/epub+zip
+application/oxps
+application/pdf
+application/x-fictionbook
diff --git a/home-manager/resources/xdg-mime/text b/home-manager/resources/xdg-mime/text
new file mode 100644
index 0000000..709cb57
--- /dev/null
+++ b/home-manager/resources/xdg-mime/text
@@ -0,0 +1,15 @@
+application/x-shellscript
+text/english
+text/plain
+text/x-c
+text/x-c++
+text/x-c++hdr
+text/x-c++src
+text/x-chdr
+text/x-csrc
+text/x-java
+text/x-makefile
+text/x-moc
+text/x-pascal
+text/x-tcl
+text/x-tex
diff --git a/home-manager/resources/xdg-mime/video b/home-manager/resources/xdg-mime/video
new file mode 100644
index 0000000..6a0839e
--- /dev/null
+++ b/home-manager/resources/xdg-mime/video
@@ -0,0 +1,55 @@
+application/mxf
+application/ogg
+application/sdp
+application/smil
+application/streamingmedia
+application/vnd.apple.mpegurl
+application/vnd.ms-asf
+application/vnd.rn-realmedia
+application/vnd.rn-realmedia-vbr
+application/x-extension-mp4
+application/x-matroska
+application/x-mpegurl
+application/x-ogg
+application/x-ogm
+application/x-ogm-video
+application/x-smil
+application/x-streamingmedia
+video/3gp
+video/3gpp
+video/3gpp2
+video/avi
+video/divx
+video/dv
+video/fli
+video/flv
+video/mkv
+video/mp2t
+video/mp4
+video/mp4v-es
+video/mpeg
+video/msvideo
+video/ogg
+video/quicktime
+video/vnd.divx
+video/vnd.mpegurl
+video/vnd.rn-realvideo
+video/webm
+video/x-avi
+video/x-flc
+video/x-flic
+video/x-flv
+video/x-m4v
+video/x-matroska
+video/x-mpeg2
+video/x-mpeg3
+video/x-ms-afs
+video/x-ms-asf
+video/x-ms-wmv
+video/x-ms-wmx
+video/x-ms-wvxvideo
+video/x-msvideo
+video/x-ogm
+video/x-ogm+ogg
+video/x-theora
+video/x-theora+ogg
diff --git a/home-manager/theme-st.nix b/home-manager/theme-st.nix
new file mode 100644
index 0000000..0a2cf34
--- /dev/null
+++ b/home-manager/theme-st.nix
@@ -0,0 +1,46 @@
+{ config, lib, pkgs, ... }: let
+ cfg = config.programs._st;
+ toString = x: if lib.isBool x then (if x then "true" else "false") else builtins.toString x;
+ # http://freedesktop.org/software/fontconfig/fontconfig-user.html
+ generateFontConfigString = name: attrs:
+ name + lib.optionalString (attrs != {}) (
+ ":" + lib.concatStringsSep ":" (
+ lib.mapAttrsToList (key: value: "${key}=${toString value}") attrs
+ )
+ )
+ ;
+ themed-st = pkgs.stdenv.mkDerivation {
+ name = "themed-st";
+ dontUnpack = true;
+ buildInputs = [ pkgs.makeWrapper ];
+ installPhase = ''
+ mkdir -p $out/bin
+ makeWrapper ${pkgs.st}/bin/st $out/bin/st \
+ --add-flags '-f"${generateFontConfigString cfg.font.name cfg.font.attrs}"'
+ '';
+ };
+in {
+ options.programs._st = {
+ enable = lib.mkEnableOption "enables theming st with home manager";
+ font = {
+ name = lib.mkOption {
+ type = lib.types.str;
+ example = "JetBrainsMonoNL Nerd Font Mono";
+ default = "monospace";
+ };
+ attrs = lib.mkOption {
+ type = lib.types.attrs;
+ default = {};
+ example = {
+ size = 12;
+ antialias = true;
+ autohint = true;
+ };
+ };
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ home.packages = [ themed-st ];
+ };
+}
diff --git a/home-manager/wallpapers.nix b/home-manager/wallpapers.nix
new file mode 100644
index 0000000..de64d76
--- /dev/null
+++ b/home-manager/wallpapers.nix
@@ -0,0 +1,17 @@
+{ lib, config, pkgs, ... }: let
+ cfg = config.programs._seasonalwallpaper.wallpapers;
+in {
+ options.programs._seasonalwallpaper.wallpapers = {
+ download = lib.mkEnableOption "enables all wallpapers";
+ };
+
+ config = lib.mkIf cfg.download {
+ home.file.wallpapers = {
+ target = ".local/share/wallpaper";
+ source = pkgs.fetchzip {
+ url = "https://tjkeller.xyz/permalinks/wallpapers.tar";
+ hash = "sha256-lhj9wUMZfd0XOrUtWY9HB64oXrS/EjsvsaJHzu4ucFg=";
+ };
+ };
+ };
+}
diff --git a/home-manager/xdg-mime.nix b/home-manager/xdg-mime.nix
new file mode 100644
index 0000000..e74b4b3
--- /dev/null
+++ b/home-manager/xdg-mime.nix
@@ -0,0 +1,42 @@
+{ config, lib, pkgs, ... }: let
+ cfg = config.xdg.mimeApps._defaultCategoryApplications;
+
+ # Mime-type category files are stored here
+ mimeResources = ./resources/xdg-mime;
+
+ # Files present in mimeResources with newline separated mime-types
+ # Would be more fun to load these dynamically with builtins.readDir, but I will be disciplined
+ categories = [ "audio" "directory" "email" "image" "pdf" "text" "video" ];
+
+ # Dynamically generate categories
+ categoryApplications = (lib.genAttrs categories (category: lib.mkOption {
+ type = lib.types.listOf lib.types.str;
+ default = [ ];
+ description = "set the default application used for ${category} files. omit '.desktop'";
+ }));
+
+ # Create list of mime-types from the category file
+ getCategoryMimeTypes = category: lib.filter (s: s != "") (lib.splitString "\n" (builtins.readFile "${mimeResources}/${category}"));
+
+ # Structure default applications for a specified category how home-manager expects
+ assignMimeTypes = applications: category: lib.map (mimetype:
+ { "${mimetype}" = lib.mkIf (applications != []) (lib.map (app: "${app}.desktop") applications); }
+ ) (getCategoryMimeTypes category);
+
+ # Combine all category applications
+ defaultApplications = lib.mkMerge (lib.flatten (
+ lib.map (category: assignMimeTypes cfg.categoryApplications.${category} category) categories
+ ));
+in {
+ options.xdg.mimeApps._defaultCategoryApplications = {
+ enable = lib.mkEnableOption "set default applications as defined in the resources dir";
+ inherit categoryApplications;
+ };
+
+ config = lib.mkIf cfg.enable {
+ xdg.mimeApps = {
+ enable = lib.mkDefault true;
+ inherit defaultApplications;
+ };
+ };
+}
diff --git a/hosts/T430/configuration.nix b/hosts/T430/configuration.nix
new file mode 100644
index 0000000..cc530d6
--- /dev/null
+++ b/hosts/T430/configuration.nix
@@ -0,0 +1,78 @@
+{ config, lib, pkgs, ... }: {
+ imports = [ ./wg.nix ];
+
+ # Setup bootloader
+ boot._loader.enable = true;
+
+ # Enable common options
+ _archetypes = {
+ profiles = {
+ desktop = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ btrfs.enable = true;
+ };
+ collections = {
+ desktop = {
+ extraUtilities.enable = true;
+ cad.enable = true;
+ chromium.enable = true;
+ crypto.enable = true;
+ graphics.enable = true;
+ office.enable = true;
+ };
+ };
+ };
+
+ # Configure charge threshold for battery
+ services.tlp = {
+ enable = true;
+ settings = {
+ START_CHARGE_THRESH_BAT0 = 55;
+ STOP_CHARGE_THRESH_BAT0 = 80;
+ };
+ };
+
+ # Enable user timmy
+ _users.timmy = {
+ enable = true;
+ autologin.enable = true;
+ wifi.enable = true;
+ nas = {
+ enable = true;
+ home.enable = true;
+ };
+ };
+
+ # Configure home
+ home-manager.users.timmy = {
+ gtk._mintTheme = {
+ dark = true;
+ color = "Purple";
+ icons.color = "Purple";
+ };
+ gtk = {
+ font.name = "monospace";
+ font.size = 8;
+ cursorTheme.size = 24;
+ };
+ programs._st = {
+ enable = true;
+ font = {
+ name = "TamzenForPowerline";
+ attrs = {
+ pixelsize = 14;
+ };
+ };
+ };
+ programs._seasonalwallpaper.wallpapers.download = true;
+ fonts.fontconfig = {
+ defaultFonts.monospace = [ "TamzenForPowerline" ];
+ subpixelRendering = "rgb";
+ hinting = "slight";
+ };
+ };
+
+ system.stateVersion = "24.05";
+}
diff --git a/hosts/T430/hardware-configuration.nix b/hosts/T430/hardware-configuration.nix
new file mode 100644
index 0000000..78b0160
--- /dev/null
+++ b/hosts/T430/hardware-configuration.nix
@@ -0,0 +1,46 @@
+# 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" "sr_mod" "sdhci_pci" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/mapper/cryptroot";
+ fsType = "btrfs";
+ options = [ "subvol=@" ];
+ };
+
+ boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/222813d7-cd5e-473a-9cdb-1a2bae74e904";
+
+ fileSystems."/home" =
+ { device = "/dev/mapper/cryptroot";
+ fsType = "btrfs";
+ options = [ "subvol=@home" ];
+ };
+
+ fileSystems."/nix" =
+ { device = "/dev/mapper/cryptroot";
+ fsType = "btrfs";
+ options = [ "subvol=@nix" ];
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/117A-6AB4";
+ fsType = "vfat";
+ options = [ "fmask=0022" "dmask=0022" ];
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/hosts/T430/resources/secrets/wg.yaml b/hosts/T430/resources/secrets/wg.yaml
new file mode 100644
index 0000000..3e29c4c
--- /dev/null
+++ b/hosts/T430/resources/secrets/wg.yaml
@@ -0,0 +1,18 @@
+wg-office: ENC[AES256_GCM,data:Ft2P1nSMqs+0obsZdulyIV5oCxid019t++A0bAHTkcpysmwCuECHODZL2EHgpbmvomMKQyzKPPdrSgGS9H+Dar/+Qko70zPSs8uQit2j6yhceSwNtb2ivD2hFCTtQr9pvSr8HgpxKtmw22tGpfXXHTmu+xBlHFizvTMEAqKdz+bvspLk/ANbcbmLVYXrb5NwksF0vaZSOkzKnpeyDyhvb8Z5GGmvWTPzP3ILK7RzpPb11/9vgyBjyyMkQfT0QpwkE7OlaH4ffX/Qg1d0T4tWOA4Fsi3h853FZ1Rukh5f3YPSsEqgLNJpClDrprYM3m2d3dDUYen4F3+58MvF8K1CWLigs9RwxqH2F5ztloHDpLAzKp/9l3xOt869uNiOqKF68102lYdCP20AQDt34Xory8Qls7QMYo0auUb7m/XVdhHQD/ohyjDHIGZG6BrbuRtuMgAu8PZh8MpdeZw1xe+5oPb2XrL3dpR7xZ/eHpcy58zVBl8SQaoCP85e1uBabnqN0fbiVFDdUNL52xTEyRknrK7RISX0zPiwDvdMRIAa172C,iv:92BzIjqwiCIfLzl9El4QoU701Q7XZE6JgpPbZZCh4ZY=,tag:+KUlo0fF5h3kMveoU4NQ9g==,type:str]
+wg-home: ENC[AES256_GCM,data:BJ29Dvv7I2nKKqpmKkUu5xrvyRXcTGURnGTmqwWbp3vbKchC1DnAyqLIeTFp7opB1kZItVTUpjvR7J8jn+48Y/xGnRNaEGdIPZwAIXPRdgX0QHFBUdw4YjBYVA82+/QqfIUBvzp/iHOsBRLkG1UNTKMozytFR6OZJNUHH8pukx5vO/ioEVOR26lfYuHH47+KOEktLpu5VlpdY7DXkYLY0/yof7MT3/9NY1KD2PWEZIq9yquPWnA+yTvm9cyhkNOQWsCC/0K5FjN/oKtf/SCt3Jb2LzuxF09+xVvzbvewhTnc3QVF0Hhf9OruJymrICNGAqYFFZCBL48nzfA7eSgaU6bg8Toq9XIuHxQ3NIrr8k7D3KmRGq2cDFL11SUolnouTgSmkfv+JBulpaOY8IjgCDZT2lmHiHdGjVKcq9MGSIUb7K6M8oXi9nbev8QZQIhdgQXRE3HZ1HJQE/3VcFTlEsJ2Y6kAIEEiAHaLK9wyrpQVYPQplVVVTapCYoE=,iv:afhs9kQqstlhmBKXQ7okSENzNt2Y9VXsQVzvENoe/Fo=,tag:hJJkQH75rNeSfs8mOkdxVg==,type:str]
+wg-office-alt: ENC[AES256_GCM,data:Wk6di/P4yh0PhhfdUUB3af326glrnaqGepNoJmBkuVptmPZi0GdnrBL5/dXxTKLI3ZjGLonwf5JCX7VcXZTRzXwv8ntv0ts87pgaQcueDE7BFqlYjdlmQz6Rv+58ETCnm5yMu1F2oRkHp93ONPpZumyNmqV6lhzQlzf2XgSzVSI/eNPJ6eb2UmQHFs4hjyl3WUPKI21VlNIwNwikQXBVo4si9SUNOIvLkSYzfurkfqQLRWt6O2OJdRx1ZWMFcHp5YKuUDHFRwKym2226I16vvic0XOJfi6Sic6uZQ5GwuiPGB938uectXyfasOC0YQ2Fzj0HqR/mpQJvwj49ulwljDvDqFDjMQMmKYPa3EiTFegaUgEMOLjnQySJpAwThkZHEOo9M298L5TZKIIHiKWTsJa6PX82SeNOw0+3FDNdFEM9gQbGUIlQmRadlQYEY7VE,iv:XwM1xtriFkQLNzSIVhA/FtON9HccFh2qR4SSmSDF7r0=,tag:O/+m9RQbtYmGsQnxsF/OsA==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB4NEN4NGxDR1oreGVoSGhE
+ TzMxSEY0QVBhS2Z6MW15ci9aVlJ0a3IyVlZBCldPRVNvcUhJSHhWSEk3akd4RjN0
+ ajhUV2d1ZWRsRFU4cTE2dGl6RmM4MGsKLS0tIFhnUjl5aDJqWVB1NE15SlNzR2Iv
+ YTNydURsOUMrSXZGdk9UOUdUQlA0SFUKxEDJRR6tpYva9qpWo9NxwCxk/xpRVoTl
+ YJkmDZzMcXikXXiro96AprP9dXJXvMPKYPGl2Zsal8PlGFPBoHW2GA==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
+ lastmodified: "2026-10-05T19:03:13Z"
+ mac: ENC[AES256_GCM,data:17HpRszIH6PbDBOV91Q9J3fQvGJnqdCG32X5OU5kzBR7sA/zMVZSNGpT/Qz7J+11ZvWn+LzErnLpZSdfg+HIBUdmxgmTaKBSPHL34O5N0vHkbt5L1Vbys+RHiK1Gb/JnqfCSu5CSwSQRmbC5GIpimHL/Ke3iaMyTvmb0nxWqG/0=,iv:I84zf/PYlSIRpUaEj7TjzqslbYJj3RfC1BhC/FaT1zI=,tag:O/YK/FVCzE3hIAl/xh1hYA==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.13.3
diff --git a/hosts/T430/wg.nix b/hosts/T430/wg.nix
new file mode 100644
index 0000000..d6a5e47
--- /dev/null
+++ b/hosts/T430/wg.nix
@@ -0,0 +1,11 @@
+{ config, pkgs, inputs, ... }: {
+ sops.secrets.wg-office.sopsFile = ./resources/secrets/wg.yaml;
+ sops.secrets.wg-office-alt.sopsFile = ./resources/secrets/wg.yaml;
+ sops.secrets.wg-home.sopsFile = ./resources/secrets/wg.yaml;
+
+ networking.wg-quick.interfaces = {
+ wg-office = { autostart = false; configFile = config.sops.secrets.wg-office.path; };
+ wg-office-alt = { autostart = false; configFile = config.sops.secrets.wg-office-alt.path; };
+ wg-home = { autostart = false; configFile = config.sops.secrets.wg-home.path; };
+ };
+}
diff --git a/hosts/X230/configuration.nix b/hosts/X230/configuration.nix
new file mode 100644
index 0000000..f54b174
--- /dev/null
+++ b/hosts/X230/configuration.nix
@@ -0,0 +1,65 @@
+{ config, lib, pkgs, ... }: {
+ imports = [ ./wg.nix ];
+
+ # Setup bootloader
+ boot._loader.enable = true;
+
+ # Enable common options
+ _archetypes = {
+ profiles = {
+ desktop = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ btrfs.enable = true;
+ };
+ collections = {
+ desktop = {
+ crypto.enable = true;
+ graphics.enable = true;
+ office.enable = true;
+ };
+ };
+ };
+
+ # Enable user timmy
+ _users.timmy = {
+ enable = true;
+ autologin.enable = true;
+ wifi.enable = true;
+ };
+
+ # Use intel driver for better performance and vsync
+ #services.xserver.videoDrivers = [ "intel" ];
+
+ # Configure home
+ home-manager.users.timmy = {
+ gtk._mintTheme = {
+ dark = true;
+ color = "Teal";
+ icons.color = "Teal";
+ };
+ fonts.fontconfig.defaultFonts.monospace = [ "TamzenForPowerline" ];
+ gtk = {
+ font.name = "monospace";
+ font.size = 8;
+ cursorTheme.size = 24;
+ };
+ programs._st = {
+ enable = true;
+ font = {
+ name = "TamzenForPowerline";
+ attrs = {
+ pixelsize = 14;
+ };
+ };
+ };
+ programs._seasonalwallpaper.wallpapers.download = true;
+ fonts.fontconfig = {
+ subpixelRendering = "rgb";
+ hinting = "full";
+ };
+ };
+
+ system.stateVersion = "24.05";
+}
diff --git a/modules/hosts/T430/hardware-configuration.nix b/hosts/X230/hardware-configuration.nix
index 206a525..0791585 100644
--- a/modules/hosts/T430/hardware-configuration.nix
+++ b/hosts/X230/hardware-configuration.nix
@@ -8,14 +8,29 @@
[ (modulesPath + "/installer/scan/not-detected.nix")
];
- boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ];
+ boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
- { device = "/dev/disk/by-uuid/b991914b-3a4c-4248-9472-b5403729601a";
+ { device = "/dev/disk/by-uuid/41036740-73bc-4004-a302-01233b4d83b8";
fsType = "btrfs";
+ options = [ "subvol=@" ];
+ };
+
+ boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/6019772f-4a1c-4abd-9c70-b1d71cc2de65";
+
+ fileSystems."/home" =
+ { device = "/dev/disk/by-uuid/41036740-73bc-4004-a302-01233b4d83b8";
+ fsType = "btrfs";
+ options = [ "subvol=@home" ];
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/72D4-F66A";
+ fsType = "vfat";
+ options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
diff --git a/hosts/X230/resources/secrets/wg0.yaml b/hosts/X230/resources/secrets/wg0.yaml
new file mode 100644
index 0000000..5941b70
--- /dev/null
+++ b/hosts/X230/resources/secrets/wg0.yaml
@@ -0,0 +1,16 @@
+wg0: ENC[AES256_GCM,data:wcgowNptTdrJNjzH6n/ulbec5+GPkuRAUNidWFy4dhClioTg8vdrXhhwP+sykwEZYOjsLurkU0Rw1w9ds+AGe3J+FnW1qKdskcY+8t/CyNY51pUbzMCKxexnNj52+0+VlH6FAUyplo6ESg/vlWCFyuyACWjQfdqDW/1PxJzrYqZ7MIwbCdntjE/84F52BqxePt3LolzvzTGUOx5Lr6Jbv9i3tv1R9NmZxt5t2gwaGbIIPWMVZh972w5HJYa8bfx67vuyj6HE46tMiu8WdQbHfjRvVIA+0OtHihpDGHfi5Q6iXpO/rk4YJZjsiEgTMTqD08HD5Gm+wBFwHSJjCOBpBsq3GsspDLNI+EXel7Gmtk+BhL1tFQdpYPwz7bHd03Znawr4Br7R0gHJg4FXnhKlG+SyDqXKirnCyCTfUotIBmU0dX4tzmwiOMyvImgXZA==,iv:GAk27qkZDopzdWnBeL7yTmyn9dM2wSzKd41NRhsyNNY=,tag:Ba7jZhqEa8dUedIvVFBbHA==,type:str]
+sops:
+ age:
+ - recipient: age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
+ enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB4NEN4NGxDR1oreGVoSGhE
+ TzMxSEY0QVBhS2Z6MW15ci9aVlJ0a3IyVlZBCldPRVNvcUhJSHhWSEk3akd4RjN0
+ ajhUV2d1ZWRsRFU4cTE2dGl6RmM4MGsKLS0tIFhnUjl5aDJqWVB1NE15SlNzR2Iv
+ YTNydURsOUMrSXZGdk9UOUdUQlA0SFUKxEDJRR6tpYva9qpWo9NxwCxk/xpRVoTl
+ YJkmDZzMcXikXXiro96AprP9dXJXvMPKYPGl2Zsal8PlGFPBoHW2GA==
+ -----END AGE ENCRYPTED FILE-----
+ lastmodified: "2026-03-09T12:36:15Z"
+ mac: ENC[AES256_GCM,data:T8hQbFrPOGYQl8tbqUMLdQN3qjhcAXmKfwqEsLQkDjr2nxUXDz8d58TUsaRvkHC4jPo9lXyPL5SSpua2kzJIcDDLPkiPB/3qV8ksJQ0dgcfLkUnrI1mtoo9AOPnHrTjstSAR2cmiFbCTqRpkLnGwI+NoCLjNjd/GNSAlMl00QMg=,iv:boSHzNAuKGkAhtkApOOJEtW4gt13mMmCin24gf3dXIs=,tag:1+4+BE8ZPgvgf4RlH6Wmhw==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.12.1
diff --git a/modules/hosts/T495/wg.nix b/hosts/X230/wg.nix
index 3881b63..3881b63 100644
--- a/modules/hosts/T495/wg.nix
+++ b/hosts/X230/wg.nix
diff --git a/hosts/flex-wg-router/configuration.nix b/hosts/flex-wg-router/configuration.nix
new file mode 100644
index 0000000..3f6ad06
--- /dev/null
+++ b/hosts/flex-wg-router/configuration.nix
@@ -0,0 +1,99 @@
+{ config, lib, pkgs, ... }: let
+ ipAddress = "10.1.1.1";
+in {
+ imports = [ ./wg.nix ];
+
+ # Setup bootloader
+ boot._loader.enable = true;
+
+ # Enable common options
+ _archetypes = {
+ profiles = {
+ headless = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ btrfs.enable = true;
+ };
+ };
+
+ # Network config
+ networking = {
+ # Label lan and wan interfaces
+ _interfaceLabels = {
+ enable = true;
+ interfaces = {
+ lan0 = "98:b7:85:22:9b:43"; # External
+ wan0 = "54:ee:75:8c:4b:2d"; # Internal
+ };
+ };
+ # Set ip addresses
+ interfaces = {
+ lan0.ipv4.addresses = [
+ { address = ipAddress; prefixLength = 24; }
+ { address = "192.168.77.4"; prefixLength = 24; }
+ ];
+ wan0.ipv4.addresses = [{
+ address = "46.110.173.163"; # Reserved static ip for wg-router
+ prefixLength = 31;
+ }];
+ };
+ defaultGateway = {
+ address = "46.110.173.161";
+ interface = "wan0";
+ };
+ # Firewall rules
+ firewall = {
+ interfaces.wan0 = {
+ allowedUDPPorts = [ 51820 ];
+ };
+ };
+ # NAT/masquerade lan0 allowing wg0 clients to access lan0
+ nftables.tables.wg-nat = {
+ family = "ip";
+ content = ''
+ chain post {
+ type nat hook postrouting priority srcnat; policy accept;
+ iifname "wg0" oifname "lan0" masquerade comment "wg0 => lan0"
+ }
+ '';
+ };
+ };
+
+ # Router config
+ services._router = {
+ routing = {
+ enable = true;
+ interfaces = {
+ lan = [ "lan0" ];
+ wan = "wan0";
+ };
+ };
+ dnsDhcpConfig = {
+ dhcp.enable = false;
+ # Point to separate dns server at pls.lan for local resolution
+ localResolution = {
+ localDomain = "pls.lan";
+ localDnsAddress = "192.168.77.1@53";
+ localReverseZone = "77.168.192.in-addr.arpa";
+ };
+ #dhcp = {
+ # defaultGateway = ipAddress;
+ # localhostIp = ipAddress;
+ # rangeStart = "10.1.1.100";
+ # rangeEnd = "10.1.1.250";
+ # staticLeases = {
+ # idrac-8HT2W52 = {
+ # macAddress = "18:fb:7b:9d:16:b3";
+ # staticIp = "10.1.1.10";
+ # };
+ # };
+ #};
+ };
+ };
+
+ # Enable user timmy
+ _users.timmy.enable = true;
+
+ system.stateVersion = "25.05";
+}
diff --git a/modules/hosts/optiplex/hardware-configuration.nix b/hosts/flex-wg-router/hardware-configuration.nix
index 3d9651e..01cff6d 100644
--- a/modules/hosts/optiplex/hardware-configuration.nix
+++ b/hosts/flex-wg-router/hardware-configuration.nix
@@ -8,29 +8,29 @@
[ (modulesPath + "/installer/scan/not-detected.nix")
];
- boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "firewire_ohci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
+ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
- { device = "/dev/disk/by-uuid/a9d54117-31f6-4cad-b1b2-250f6bfd7808";
+ { device = "/dev/disk/by-uuid/01eae5fd-a46e-4a36-8a9d-247a0b16bcef";
fsType = "btrfs";
options = [ "subvol=@" ];
};
- fileSystems."/home" =
- { device = "/dev/disk/by-uuid/a9d54117-31f6-4cad-b1b2-250f6bfd7808";
- fsType = "btrfs";
- options = [ "subvol=@home" ];
- };
-
fileSystems."/boot" =
- { device = "/dev/disk/by-uuid/6987-81B6";
+ { device = "/dev/disk/by-uuid/345A-436A";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
+ fileSystems."/home" =
+ { device = "/dev/disk/by-uuid/01eae5fd-a46e-4a36-8a9d-247a0b16bcef";
+ fsType = "btrfs";
+ options = [ "subvol=@home" ];
+ };
+
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
@@ -38,7 +38,7 @@
# 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.eno1.useDHCP = lib.mkDefault true;
+ # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
diff --git a/hosts/flex-wg-router/resources/secrets/wg.yaml b/hosts/flex-wg-router/resources/secrets/wg.yaml
new file mode 100644
index 0000000..dc80ca3
--- /dev/null
+++ b/hosts/flex-wg-router/resources/secrets/wg.yaml
@@ -0,0 +1,17 @@
+wg1: ENC[AES256_GCM,data:GDmORbMvBY9vQ0eppWM71eABSVFgGeoGD7CTu5otyAWr/fGKraGaRKHnj3i/wTQV2oxeI1eBKJoAcNI4vdoS584pffo9qXi5A8xQ6UppqEdqbMGqsoiVElGbJXoZxx9Lgl0abgy9DOvMNFhWQzEPnqW/QRXxzClsazB0oveafqx1cXMnU4WestLKvCyK7UL5GVCrp18qw2UzIeuoTY9zyQ3Dt9/Tmlg9tsjLy4bWmTyrgyeYOKc2x0Aocxz6yvadN76Vp6vm9Fcxvu0szxBrVauIxCzqpL6pyy3wvLm+aka6CkLhviZ38GtZ8GXXSqB1Lf52mz3udKqLZAau1ANqfAhzKqUapKPxn+fpo+JIIRw4+boXtO/3Z8YPjiyUQcFrhRkSCI7cm2w+rCcm/p+2YiBPpMGSCDcyJqZeKbgM8MPkpbr3EEg4ruqNJYN/cnk=,iv:O8QYsHCEzTW6Y4s31OKjjcAxAToQwLfAIEzCtUZT6IM=,tag:M0Juai3qMJiabN1kgYLvOA==,type:str]
+wg0: ENC[AES256_GCM,data:/tipovCGtQ6XKdxejML3DYj2FwA8LOi8Zrj+f5zAABJ8aubSJRrVOrel9kb36h8NC0IIbYEOVuWEzIAok+k3ZvybIkUfDM+kNcTGQeb15EPunonbSyVN2g0POZBY/+gGCLwm4OaN1aLtmwDqhJD8hCj9Gq1mzpeUU0PKmaClY37MHb1IgR0YRnEsjVL5AT2JYCTgWylSmvwPEXz32dABqdOPbGzTP24coHv5HVFXf9ljiZGZQlFkHVMn7/fpQnh/5NyP6EePIps7hfpOHmnjn1kFhhXwVKQAzZmRZYmhbGB297uyUpMFoQbEV8R9q1ON+B1ZCe+cXOsKB65ls5dFVSDgLkEZiA141H3yGrsIjWB3nQiU5MmJXVEzW2BXt37YLc6xQiUMHcHLZru8TR6FfJ6Y6jen7w9pPAtY78DL64R/m4wvvvJhxI4h/GMCo7RZdqoWZAm8KNj0U4sSlbJjVCbvToUyqBydgPyZc62o8s+Bi0TC6RTxCX/vDLrudh7S8Bvy6QSpqMXE4bjBPJEwccu/F2Awf2oz1u+QfnpUYI6LcW+rhgfjQfFFM117biRbmfwTFyImnMwXsxmycJL9OrykuvOAvHNhop58GJ+S1lGbTA8CAfbzwgyk7HGiAbNg3EA0GvB2sMJg+7vLDNrHgKgKChU7o9/Nk3NyxR7ML7otbRQr9RTH4OncQv2iJvlclM5E7R9sfzI7er8fPRxSSDrDavwxetQM5lgP9EidpTLGOtw2sNmmq4w9ImoLtpYgTtw1v2oVTbNalerkLpI1qcCwD5j/PIevg2xa9CPlmbrWmpis0hM1k/QwnquUWKbwIweGK8QJT5V71KKc1gtWX0Euuy/ISU3radLnsmSh,iv:9Qs0+6rx+er8HfkGMFZA8aYGvqk46kDaE3Pyd7kJ/aY=,tag:QbV9n9kSX9ftEBL9LO4pRw==,type:str]
+sops:
+ age:
+ - recipient: age1f0tmpy2nam58skmznjyqd3zf54rxtfrk6fda0vlpq9y3yg6wac7sjf0vja
+ enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoNVZ5dmNSd1NRQUhURkl2
+ dnk3MkNjMFUyNnU5L1FFNTV0a1NUbUZ6ZUEwCmNNUldIdnoycVpwUHJrcXZvZXp5
+ NGVHcUlHUm1uK0QxV1JmdDVyQVoxZDgKLS0tIDJhSHhkYjNML045SHNobytucnVZ
+ L25wUWRJbzZMZDFseXdvOFJXQVRxN28KJjC3ola24tTEV8tFYpnsId4d0S+jHkS9
+ ME6i4jorWRlQKdYn/gTUoqgMAvJEc73hjTfgX6bFshhuhflfGxXQQw==
+ -----END AGE ENCRYPTED FILE-----
+ lastmodified: "2026-10-06T18:10:05Z"
+ mac: ENC[AES256_GCM,data:zR2u6zFW/MVI5pH3w909JLvAEsAHK2Sb5mNzFFQMzLcPsSjZf6CZQWUS7WVbvtMYF9gJFNEikYs7hGR5q7IG98Najcc4Jht0J6nmv812gptB78CtX3MXv06QP8LBjXkIDTg2pCSAqdifn9BmWD8ObrHfNciUn/OO9c+bR5+lGg8=,iv:h3KtOUnMeuR6PA2SerfyyAV7uMtrujsizu1KC47Ngtw=,tag:l8Of/f7TgHmjbvHh4EwhOQ==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.12.1
diff --git a/hosts/flex-wg-router/wg.nix b/hosts/flex-wg-router/wg.nix
new file mode 100644
index 0000000..9ff9395
--- /dev/null
+++ b/hosts/flex-wg-router/wg.nix
@@ -0,0 +1,7 @@
+{ config, pkgs, inputs, ... }: {
+ sops.secrets.wg0.sopsFile = ./resources/secrets/wg.yaml;
+
+ networking.wg-quick.interfaces = {
+ wg0.configFile = config.sops.secrets.wg0.path;
+ };
+}
diff --git a/hosts/gnuslashprinter/configuration.nix b/hosts/gnuslashprinter/configuration.nix
new file mode 100644
index 0000000..9e1f734
--- /dev/null
+++ b/hosts/gnuslashprinter/configuration.nix
@@ -0,0 +1,29 @@
+{
+ imports = [
+ ./flask-relay-ctl.nix
+ ./klipper.nix
+ ];
+
+ boot._loader.enable = true;
+
+ _archetypes = {
+ profiles = {
+ headless = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ btrfs.enable = true;
+ };
+ };
+
+ # Enable user timmy
+ _users.timmy.enable = true;
+
+ # Name devices
+ services.udev.extraRules = ''
+ SUBSYSTEM=="tty", KERNELS=="3-9", SYMLINK+="gsp-power"
+ SUBSYSTEM=="tty", KERNELS=="3-10", SYMLINK+="gsp-control"
+ '';
+
+ system.stateVersion = "25.11";
+}
diff --git a/hosts/gnuslashprinter/flask-relay-ctl.nix b/hosts/gnuslashprinter/flask-relay-ctl.nix
new file mode 100644
index 0000000..27507b6
--- /dev/null
+++ b/hosts/gnuslashprinter/flask-relay-ctl.nix
@@ -0,0 +1,37 @@
+{ pkgs, ... }: let
+ flaskrelayctl = pkgs.python3Packages.buildPythonApplication {
+ pname = "flaskrelayctl";
+ version = "1.0";
+ src = ./resources/flaskrelayctl;
+ pyproject = true;
+ build-system = with pkgs.python3Packages; [ setuptools ];
+ dependencies = with pkgs.python3Packages; [
+ flask
+ pyserial
+ ];
+ };
+in {
+ users.users.relay-api = {
+ isSystemUser = true;
+ group = "relay-api";
+ extraGroups = [ "dialout" ];
+ };
+ users.groups.relay-api = {};
+
+ systemd.services.relay-api = let
+ RELAYCTL_DEV = "/dev/gsp-power";
+ in {
+ description = "USB Relay Flask API";
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" ];
+ serviceConfig = {
+ User = "relay-api";
+ Group = "relay-api";
+ ExecStart = "${flaskrelayctl}/bin/flaskrelayctl";
+ Restart = "always";
+ DeviceAllow = [ "${RELAYCTL_DEV} rw" ];
+ };
+ };
+
+ environment.systemPackages = [ flaskrelayctl ];
+}
diff --git a/hosts/gnuslashprinter/hardware-configuration.nix b/hosts/gnuslashprinter/hardware-configuration.nix
new file mode 100644
index 0000000..278d6e6
--- /dev/null
+++ b/hosts/gnuslashprinter/hardware-configuration.nix
@@ -0,0 +1,44 @@
+# 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" "usbhid" "usb_storage" "sd_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/416a481f-d656-4bd1-acdb-bd0a6f2d2c3a";
+ fsType = "btrfs";
+ options = [ "subvol=@" ];
+ };
+
+ fileSystems."/home" =
+ { device = "/dev/disk/by-uuid/416a481f-d656-4bd1-acdb-bd0a6f2d2c3a";
+ fsType = "btrfs";
+ options = [ "subvol=@home" ];
+ };
+
+ fileSystems."/nix" =
+ { device = "/dev/disk/by-uuid/416a481f-d656-4bd1-acdb-bd0a6f2d2c3a";
+ fsType = "btrfs";
+ options = [ "subvol=@nix" ];
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/18C4-6D53";
+ fsType = "vfat";
+ options = [ "fmask=0022" "dmask=0022" ];
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/hosts/gnuslashprinter/klipper.nix b/hosts/gnuslashprinter/klipper.nix
new file mode 100644
index 0000000..331a0c7
--- /dev/null
+++ b/hosts/gnuslashprinter/klipper.nix
@@ -0,0 +1,100 @@
+{
+ # Klipper firmware
+ services.klipper = {
+ enable = true;
+ firmwares = {
+ mcu = {
+ enable = true;
+ # Serial port connected to the microcontroller
+ serial = "/dev/gsp-control";
+ # Klipper flash must be enabled in order to build mcu firmware
+ # The resulting `klipper-flash-mcu` command will show the location of the firmware bin in the nix store
+ enableKlipperFlash = true;
+ # Run klipper-genconf to generate this
+ configFile = ./resources/klipper/mcu/config;
+ };
+ };
+ configFile = ./resources/klipper/printer.cfg;
+ logFile = "/var/lib/klipper/klipper.log";
+ };
+ # Mutable config
+ services.klipper.mutableConfig = true;
+ #configDir = "/var/lib/moonraker/config"; # Accessible by moonraker # TODO
+
+ # Moonraker web-api
+ security.polkit.enable = true; # required for services.moonraker.allowSystemControl
+ services.moonraker = {
+ user = "root";
+ enable = true;
+ address = "0.0.0.0";
+ allowSystemControl = true;
+ settings = {
+ authorization = {
+ force_logins = true;
+ cors_domains = [
+ "*.local"
+ "*.lan"
+ "*://app.fluidd.xyz"
+ "*://my.mainsail.xyz"
+ ];
+ trusted_clients = [
+ "10.0.0.0/8"
+ "127.0.0.0/8"
+ "169.254.0.0/16"
+ "172.16.0.0/12"
+ "192.168.0.0/16"
+ "FE80::/10"
+ "::1/128"
+ ];
+ };
+ #file_manager.check_klipper_config_path = false; # Disable warning when klipper config is not accessible by moonraker
+ # mainsail.cfg
+ #"update_manager mainsail-config" = {
+ # type = "git_repo";
+ # primary_branch = "master";
+ # path = "~/mainsail-config";
+ # origin = "https://github.com/mainsail-crew/mainsail-config.git";
+ # managed_services = "klipper";
+ #};
+
+ "power printer" = let
+ relayApiHost = "http://localhost:5050";
+ in {
+ type = "http";
+ on_url = "${relayApiHost}/on";
+ off_url = "${relayApiHost}/off";
+ status_url = "${relayApiHost}/status";
+ response_template = ''
+
+ # The module will perform the "GET" request using the appropriate url.
+ # We use the `last_response` method to fetch the result and decode the
+ # json response.
+ {% set resp = http_request.last_response().json() %}
+ # The expression below will render "on" or "off".
+ {resp["state"].lower()}
+ '';
+ off_when_shutdown = true;
+ on_when_job_queued = true;
+ locked_while_printing = true;
+ restart_klipper_when_powered = true;
+ restart_delay = "1";
+ bound_services = "klipper";
+ initial_state = "off";
+ };
+ };
+ };
+
+ # Mainsail web-interface
+ services.mainsail = {
+ enable = true;
+ hostName = "0.0.0.0";
+ nginx.listenAddresses = [ "0.0.0.0" ];
+ };
+ services.nginx.clientMaxBodySize = "1000m"; # Allow large gcodes, etc.
+ networking.firewall.allowedTCPPorts = [ 80 ]; # Port for mainsail via nginx
+
+ # Webcam support in mainsail
+ # TODO hook to restart ustreamer when webcam is connected
+ services.ustreamer.enable = true;
+ services.mainsail.nginx.locations."/webcam/".proxyPass = "http://localhost:8080/stream"; # Default location for ustreamer stream
+}
diff --git a/hosts/gnuslashprinter/resources/flaskrelayctl/pyproject.toml b/hosts/gnuslashprinter/resources/flaskrelayctl/pyproject.toml
new file mode 100644
index 0000000..b151b74
--- /dev/null
+++ b/hosts/gnuslashprinter/resources/flaskrelayctl/pyproject.toml
@@ -0,0 +1,10 @@
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "flaskrelayctl"
+version = "1.0"
+
+[project.scripts]
+flaskrelayctl = "server:main"
diff --git a/hosts/gnuslashprinter/resources/flaskrelayctl/server/__init__.py b/hosts/gnuslashprinter/resources/flaskrelayctl/server/__init__.py
new file mode 100644
index 0000000..f2c0bc3
--- /dev/null
+++ b/hosts/gnuslashprinter/resources/flaskrelayctl/server/__init__.py
@@ -0,0 +1,54 @@
+from flask import Flask, jsonify
+import serial
+import os
+
+app = Flask(__name__)
+
+RELAY_DEV = os.environ.get("RELAYCTL_DEV", "/dev/ttyUSB0")
+RELAY_HOST = os.environ.get("RELAYCTL_HOST", "127.0.0.1")
+RELAY_PORT = os.environ.get("RELAYCTL_PORT", "5050")
+RELAY_BAUD = 9600
+RELAY_ID = 1 # NOTE: multi relay boards are not supported (only relay id 1)
+
+def get_cmd(state: bool):
+ """
+ LCUS relay 4-byte control command syntax is as follows:
+ start: always 0xA0
+ relay: id of relay (counts from 1)
+ state: coil energized 0 or 1
+ checksum: sum of previous 3 bytes
+ """
+ start = 0xA0
+ relay = RELAY_ID
+ state = int(state)
+ checksum = start + relay + state
+ return bytes((start, relay, state, checksum))
+
+def get_serial():
+ return serial.Serial(RELAY_DEV, RELAY_BAUD, timeout=1)
+
+@app.route("/on", methods=["GET", "POST"])
+def on():
+ with get_serial() as ser:
+ ser.write(get_cmd(True))
+ return jsonify({"state": "ON"})
+
+@app.route("/off", methods=["GET", "POST"])
+def off():
+ with get_serial() as ser:
+ ser.write(get_cmd(False))
+ return jsonify({"state": "OFF"})
+
+@app.route("/status", methods=["GET"])
+def status():
+ with get_serial() as ser:
+ ser.write(bytes((0xFF,))) # write 0xFF to get status
+ r = ser.readline()
+ state = r.decode("utf-8").removeprefix("CH1: ").strip()
+ return jsonify({"state": state})
+
+def main():
+ app.run(host=RELAY_HOST, port=int(RELAY_PORT))
+
+if __name__ == "__main__":
+ main()
diff --git a/hosts/gnuslashprinter/resources/klipper/mcu/config b/hosts/gnuslashprinter/resources/klipper/mcu/config
new file mode 100644
index 0000000..3e192a3
--- /dev/null
+++ b/hosts/gnuslashprinter/resources/klipper/mcu/config
@@ -0,0 +1,109 @@
+# CONFIG_LOW_LEVEL_OPTIONS is not set
+# CONFIG_MACH_AVR is not set
+# CONFIG_MACH_ATSAM is not set
+# CONFIG_MACH_ATSAMD is not set
+# CONFIG_MACH_LPC176X is not set
+CONFIG_MACH_STM32=y
+# CONFIG_MACH_HC32F460 is not set
+# CONFIG_MACH_RPXXXX is not set
+# CONFIG_MACH_PRU is not set
+# CONFIG_MACH_AR100 is not set
+# CONFIG_MACH_LINUX is not set
+# CONFIG_MACH_SIMU is not set
+CONFIG_BOARD_DIRECTORY="stm32"
+CONFIG_MCU="stm32f103xe"
+CONFIG_CLOCK_FREQ=72000000
+CONFIG_SERIAL=y
+CONFIG_FLASH_SIZE=0x10000
+CONFIG_FLASH_BOOT_ADDRESS=0x8000000
+CONFIG_RAM_START=0x20000000
+CONFIG_RAM_SIZE=0x5000
+CONFIG_STACK_SIZE=512
+CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
+CONFIG_STM32_SELECT=y
+CONFIG_MACH_STM32F103=y
+# CONFIG_MACH_STM32F207 is not set
+# CONFIG_MACH_STM32F401 is not set
+# CONFIG_MACH_STM32F405 is not set
+# CONFIG_MACH_STM32F407 is not set
+# CONFIG_MACH_STM32F429 is not set
+# CONFIG_MACH_STM32F446 is not set
+# CONFIG_MACH_STM32F765 is not set
+# CONFIG_MACH_STM32F031 is not set
+# CONFIG_MACH_STM32F042 is not set
+# CONFIG_MACH_STM32F070 is not set
+# CONFIG_MACH_STM32F072 is not set
+# CONFIG_MACH_STM32G070 is not set
+# CONFIG_MACH_STM32G071 is not set
+# CONFIG_MACH_STM32G0B0 is not set
+# CONFIG_MACH_STM32G0B1 is not set
+# CONFIG_MACH_STM32G431 is not set
+# CONFIG_MACH_STM32G474 is not set
+# CONFIG_MACH_STM32H723 is not set
+# CONFIG_MACH_STM32H743 is not set
+# CONFIG_MACH_STM32H750 is not set
+# CONFIG_MACH_STM32L412 is not set
+# CONFIG_MACH_N32G452 is not set
+# CONFIG_MACH_N32G455 is not set
+CONFIG_MACH_STM32F1=y
+CONFIG_HAVE_STM32_USBFS=y
+CONFIG_STM32_USB_DOUBLE_BUFFER_TX=y
+CONFIG_HAVE_STM32_CANBUS=y
+CONFIG_STM32_DFU_ROM_ADDRESS=0
+# CONFIG_STM32_FLASH_START_2000 is not set
+# CONFIG_STM32_FLASH_START_5000 is not set
+CONFIG_STM32_FLASH_START_7000=y
+# CONFIG_STM32_FLASH_START_8000 is not set
+# CONFIG_STM32_FLASH_START_8800 is not set
+# CONFIG_STM32_FLASH_START_9000 is not set
+# CONFIG_STM32_FLASH_START_10000 is not set
+# CONFIG_STM32_FLASH_START_800 is not set
+# CONFIG_STM32_FLASH_START_1000 is not set
+# CONFIG_STM32_FLASH_START_4000 is not set
+# CONFIG_STM32_FLASH_START_0000 is not set
+CONFIG_CLOCK_REF_FREQ=8000000
+CONFIG_STM32F0_TRIM=16
+# CONFIG_STM32_USB_PA11_PA12 is not set
+CONFIG_STM32_SERIAL_USART1=y
+# CONFIG_STM32_CANBUS_PA11_PA12 is not set
+# CONFIG_STM32_CANBUS_PA11_PB9 is not set
+CONFIG_SERIAL_BAUD=250000
+CONFIG_USB_VENDOR_ID=0x1d50
+CONFIG_USB_DEVICE_ID=0x614e
+CONFIG_USB_SERIAL_NUMBER="12345"
+CONFIG_WANT_ADC=y
+CONFIG_WANT_SPI=y
+CONFIG_WANT_SOFTWARE_SPI=y
+CONFIG_WANT_I2C=y
+CONFIG_WANT_SOFTWARE_I2C=y
+CONFIG_WANT_HARD_PWM=y
+CONFIG_WANT_BUTTONS=y
+CONFIG_WANT_TMCUART=y
+CONFIG_WANT_NEOPIXEL=y
+CONFIG_WANT_PULSE_COUNTER=y
+CONFIG_WANT_ST7920=y
+CONFIG_WANT_HD44780=y
+CONFIG_WANT_ADXL345=y
+CONFIG_WANT_LIS2DW=y
+CONFIG_WANT_MPU9250=y
+CONFIG_WANT_ICM20948=y
+CONFIG_WANT_THERMOCOUPLE=y
+CONFIG_WANT_HX71X=y
+CONFIG_WANT_ADS1220=y
+CONFIG_WANT_LDC1612=y
+CONFIG_WANT_SENSOR_ANGLE=y
+CONFIG_NEED_SENSOR_BULK=y
+CONFIG_WANT_LOAD_CELL_PROBE=y
+CONFIG_NEED_SOS_FILTER=y
+CONFIG_CANBUS_FREQUENCY=1000000
+CONFIG_INLINE_STEPPER_HACK=y
+CONFIG_HAVE_STEPPER_OPTIMIZED_BOTH_EDGE=y
+CONFIG_WANT_STEPPER_OPTIMIZED_BOTH_EDGE=y
+CONFIG_HAVE_GPIO=y
+CONFIG_HAVE_GPIO_ADC=y
+CONFIG_HAVE_GPIO_SPI=y
+CONFIG_HAVE_GPIO_I2C=y
+CONFIG_HAVE_GPIO_HARD_PWM=y
+CONFIG_HAVE_STRICT_TIMING=y
+CONFIG_HAVE_CHIPID=y
+CONFIG_HAVE_BOOTLOADER_REQUEST=y
diff --git a/hosts/gnuslashprinter/resources/klipper/printer.cfg b/hosts/gnuslashprinter/resources/klipper/printer.cfg
new file mode 100644
index 0000000..4baba56
--- /dev/null
+++ b/hosts/gnuslashprinter/resources/klipper/printer.cfg
@@ -0,0 +1,180 @@
+# This file contains pin mappings for the stock 2020 Creality Ender 3
+# V2. To use this config, during "make menuconfig" select the
+# STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9)
+# communication.
+
+# If you prefer a direct serial connection, in "make menuconfig"
+# select "Enable extra low-level configuration options" and select
+# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
+# cable used for the LCD module as follows:
+# 3: Tx, 4: Rx, 9: GND, 10: VCC
+
+# Flash this firmware by copying "out/klipper.bin" to a SD card and
+# turning on the printer with the card inserted. The firmware
+# filename must end in ".bin" and must not match the last filename
+# that was flashed.
+
+# See docs/Config_Reference.md for a description of parameters.
+
+[include mainsail.cfg]
+
+# Default V2 config
+[stepper_x]
+step_pin: PC2
+dir_pin: PB9
+enable_pin: !PC3
+microsteps: 16
+rotation_distance: 40
+endstop_pin: ^PA5
+position_endstop: -20
+position_min: -20
+position_max: 235
+homing_speed: 50
+
+[stepper_y]
+step_pin: PB8
+dir_pin: PB7
+enable_pin: !PC3
+microsteps: 16
+rotation_distance: 40
+endstop_pin: ^PA6
+position_endstop: -8
+position_min: -8
+position_max: 235
+homing_speed: 50
+
+[stepper_z]
+step_pin: PB6
+dir_pin: !PB5
+enable_pin: !PC3
+microsteps: 16
+rotation_distance: 8
+endstop_pin: probe:z_virtual_endstop
+#position_endstop: 0.0
+position_min: -5
+position_max: 250
+
+[extruder]
+max_extrude_only_distance: 100.0
+step_pin: PB4
+dir_pin: PB3
+enable_pin: !PC3
+microsteps: 16
+rotation_distance: 34.406
+nozzle_diameter: 0.400
+filament_diameter: 1.750
+heater_pin: PA1
+sensor_type: EPCOS 100K B57560G104F
+sensor_pin: PC5
+control: pid
+# tuned for stock hardware with 200 degree Celsius target
+pid_Kp: 21.527
+pid_Ki: 1.063
+pid_Kd: 108.982
+min_temp: 0
+max_temp: 250
+
+[heater_bed]
+heater_pin: PA2
+sensor_type: EPCOS 100K B57560G104F
+sensor_pin: PC4
+control: pid
+# tuned for stock hardware with 50 degree Celsius target
+pid_Kp: 54.027
+pid_Ki: 0.770
+pid_Kd: 948.182
+min_temp: 0
+max_temp: 130
+
+[fan]
+pin: PA0
+
+[mcu]
+serial: /dev/gsp-control
+restart_method: command
+
+[printer]
+kinematics: cartesian
+max_velocity: 300
+max_accel: 3000
+max_z_velocity: 5
+max_z_accel: 100
+
+######################################################################
+# 128x64 Full Graphic Creality CR10 / ENDER 3 stockdisplay
+######################################################################
+
+# This section is used for a Creality "12864" display with a single
+# ribbon cable between the display's EXP3 plug and the
+# micro-controller board's EXP1 connector.
+
+[display]
+lcd_type: st7920
+cs_pin: EXP1_7
+sclk_pin: EXP1_6
+sid_pin: EXP1_8
+encoder_pins: ^EXP1_5, ^EXP1_3
+click_pin: ^!EXP1_2
+
+[output_pin beeper]
+pin: EXP1_1
+
+[board_pins]
+aliases:
+ EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
+ EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
+ PROBE_IN=PB1,PROBE_OUT=PB0,FIL_RUNOUT=PA6
+
+[display_status]
+
+######
+# Bed leveling
+
+[bltouch]
+sensor_pin: ^PROBE_IN
+control_pin: PROBE_OUT
+x_offset: -40
+y_offset: -12
+#z_offset: 1.1
+probe_with_touch_mode: true
+stow_on_each_sample: false
+
+[bed_mesh]
+speed: 120
+mesh_min: 10, 10
+mesh_max: 195, 220
+probe_count: 5,5
+algorithm: bicubic
+
+[safe_z_home]
+home_xy_position: 157.5, 129.5
+speed: 75
+z_hop: 10
+z_hop_speed: 5
+move_to_previous: true
+
+
+#*# <---------------------- SAVE_CONFIG ---------------------->
+#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
+#*#
+#*# [bed_mesh default]
+#*# version = 1
+#*# points =
+#*# -0.017500, 0.025000, 0.050000, 0.122500, 0.155000
+#*# -0.045000, -0.040000, 0.037500, 0.102500, 0.145000
+#*# -0.007500, -0.032500, 0.005000, 0.092500, 0.132500
+#*# -0.060000, -0.045000, -0.007500, 0.087500, 0.127500
+#*# 0.075000, 0.042500, 0.015000, 0.105000, 0.175000
+#*# x_count = 5
+#*# y_count = 5
+#*# mesh_x_pps = 2
+#*# mesh_y_pps = 2
+#*# algo = bicubic
+#*# tension = 0.2
+#*# min_x = 10.0
+#*# max_x = 195.0
+#*# min_y = 10.0
+#*# max_y = 220.0
+#*#
+#*# [bltouch]
+#*# z_offset = 1.342
diff --git a/hosts/libreX60/bios-flashing.nix b/hosts/libreX60/bios-flashing.nix
new file mode 100644
index 0000000..6117813
--- /dev/null
+++ b/hosts/libreX60/bios-flashing.nix
@@ -0,0 +1,8 @@
+# https://libreboot.org/docs/install/#thinkpad-t60x60x60tabletx60s
+
+{ pkgs, ... }: {
+ environment.systemPackages = [ pkgs.flashprog ];
+
+ boot.kernelParams = [ "iomem=relaxed" ];
+}
+
diff --git a/hosts/libreX60/configuration.nix b/hosts/libreX60/configuration.nix
new file mode 100644
index 0000000..bf4f388
--- /dev/null
+++ b/hosts/libreX60/configuration.nix
@@ -0,0 +1,47 @@
+{ config, lib, pkgs, ... }: {
+ imports = [
+ ./powertop-auto-tune.nix
+ # Uncomment this module and reboot to enable bios flashing
+ #./bios-flashing.nix
+ ];
+
+ # Use grub
+ boot._loader = {
+ enable = true;
+ loader = "grub";
+ mode = "bios";
+ grub.biosDevice = "/dev/sda";
+ };
+
+ # NOTE libre kernel removed, check back later
+ # Use libre kernel
+ #boot.kernelPackages = pkgs.linuxPackages-libre;
+
+ # Enable common options
+ _archetypes = {
+ profiles = {
+ desktop = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ btrfs.enable = true;
+ };
+ };
+
+ # Enable user timmy
+ _users.timmy = {
+ enable = true;
+ autologin.enable = true;
+ wifi.enable = true;
+ };
+
+ # i915 Gpu requires intel driver
+ services.xserver.videoDrivers = [ "intel" ];
+
+ # Configure home
+ home-manager.users.timmy = {
+ imports = [ ./home.nix ];
+ };
+
+ system.stateVersion = "24.11";
+}
diff --git a/modules/hosts/T495/hardware-configuration.nix b/hosts/libreX60/hardware-configuration.nix
index 6258a83..b0a7868 100644
--- a/modules/hosts/T495/hardware-configuration.nix
+++ b/hosts/libreX60/hardware-configuration.nix
@@ -8,27 +8,25 @@
[ (modulesPath + "/installer/scan/not-detected.nix")
];
- boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
+ boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ata_piix" "ahci" "firewire_ohci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ "kvm-amd" ];
+ boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
- { device = "/dev/disk/by-uuid/4256823f-107b-41a9-851d-6bd9939f1f4b";
+ { device = "/dev/disk/by-uuid/91572803-436d-4f43-b41f-dfba2103752e";
fsType = "btrfs";
options = [ "subvol=@" ];
};
- boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/f20115a9-0a0e-43d2-9cee-c705b2de43b9";
-
fileSystems."/home" =
- { device = "/dev/disk/by-uuid/4256823f-107b-41a9-851d-6bd9939f1f4b";
+ { device = "/dev/disk/by-uuid/91572803-436d-4f43-b41f-dfba2103752e";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/boot" =
- { device = "/dev/disk/by-uuid/9441-53B1";
+ { device = "/dev/disk/by-uuid/F618-D6C2";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
@@ -40,10 +38,9 @@
# 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.enp3s0f0.useDHCP = lib.mkDefault true;
- # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
- # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
+ networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
+ networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
- hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
diff --git a/hosts/libreX60/home-timmy/configuration.nix b/hosts/libreX60/home-timmy/configuration.nix
new file mode 100644
index 0000000..a5f064c
--- /dev/null
+++ b/hosts/libreX60/home-timmy/configuration.nix
@@ -0,0 +1,8 @@
+{
+ imports = [ ../home.nix ];
+
+ targets.genericLinux.enable = true;
+
+ _archetypes.profiles.desktop.enable = true;
+ _users.timmy.home.enable = true;
+}
diff --git a/hosts/libreX60/home.nix b/hosts/libreX60/home.nix
new file mode 100644
index 0000000..b537fc2
--- /dev/null
+++ b/hosts/libreX60/home.nix
@@ -0,0 +1,22 @@
+{
+ gtk._mintTheme = {
+ dark = true;
+ color = "Red";
+ icons.color = "Red";
+ };
+ fonts.fontconfig.defaultFonts.monospace = [ "TamzenForPowerline" ];
+ gtk = {
+ font.name = "monospace";
+ font.size = 8;
+ cursorTheme.size = 24;
+ };
+ programs._st = {
+ enable = true;
+ font = {
+ name = "TamzenForPowerline";
+ attrs = {
+ pixelsize = 14;
+ };
+ };
+ };
+}
diff --git a/hosts/libreX60/powertop-auto-tune.nix b/hosts/libreX60/powertop-auto-tune.nix
new file mode 100644
index 0000000..0eb9578
--- /dev/null
+++ b/hosts/libreX60/powertop-auto-tune.nix
@@ -0,0 +1,17 @@
+# https://en.wikibooks.org/wiki/Libreboot/ThinkPad_X60#Remove_High_Pitched_Whining_Noise
+# TLDR; running `powertop --auto-tune` is supposed to kill the high pitched noises produced by the X60
+
+{ pkgs, ... }: {
+ environment.systemPackages = [ pkgs.powertop ];
+
+ # Create systemd service
+ systemd.services.powertop-autotune = {
+ description = "Powertop Auto-Tune";
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" ];
+ serviceConfig = {
+ Type = "oneshot";
+ ExecStart = "${pkgs.powertop}/bin/powertop --auto-tune";
+ };
+ };
+}
diff --git a/hosts/office-precision/configuration.nix b/hosts/office-precision/configuration.nix
new file mode 100644
index 0000000..31ba38e
--- /dev/null
+++ b/hosts/office-precision/configuration.nix
@@ -0,0 +1,123 @@
+{ config, lib, pkgs, ... }: {
+ imports = [
+ ./g610.nix
+ ./wg.nix
+ ];
+
+ # Setup bootloader
+ boot._loader.enable = true;
+
+ # Enable common options
+ _archetypes = {
+ profiles = {
+ desktop = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ gnome = {
+ home.users.timmy.enable = true;
+ home.users.guest.enable = true;
+ enable = true;
+ };
+ btrfs.enable = true;
+ };
+ collections = {
+ desktop = {
+ extraUtilities.enable = true;
+ chromium.enable = true;
+ graphics.enable = true;
+ office.enable = true;
+ };
+ development = {
+ docker.enable = true;
+ web = {
+ node.enable = true;
+ };
+ };
+ virtualization.enable = true;
+ };
+ };
+
+ # Add second ip address for flex-wg-router
+ networking = {
+ _interfaceLabels = {
+ enable = true;
+ interfaces.eth0 = "48:4d:7e:f8:96:47";
+ };
+ interfaces.eth0 = {
+ useDHCP = true;
+
+ ipv4.addresses = [{
+ address = "10.1.1.3";
+ prefixLength = 24;
+ }];
+ };
+ };
+
+ # Enable user timmy
+ _users.timmy = {
+ enable = true;
+ nas = {
+ enable = true;
+ office.enable = true;
+ office.automount = true;
+ };
+ };
+
+ users.users.guest = {
+ description = "Guest";
+ isNormalUser = true;
+ };
+
+ # Disable suspend
+ systemd._suspend.disable = true;
+
+ # Allow unfree for nvidia
+ nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
+ "nvidia-kernel-modules"
+ "nvidia-settings"
+ "nvidia-x11"
+ ];
+
+ # Use nvidia driver
+ services.xserver.videoDrivers = [ "nvidia" ];
+ hardware.nvidia = {
+ modesetting.enable = true; # Required
+ powerManagement.enable = false; # Can cause bugs
+ powerManagement.finegrained = false; # Only works on turing and newer
+ nvidiaSettings = true;
+ open = false; # Not compatible w/ GTX-1030
+ package = config.boot.kernelPackages.nvidiaPackages.legacy_580;
+ forceFullCompositionPipeline = true; # Enables vsync
+ };
+
+ # Configure home
+ home-manager.users.timmy = {
+ gtk._mintTheme = {
+ dark = true;
+ color = "Blue";
+ icons.color = "Blue";
+ };
+ programs._seasonalwallpaper.wallpapers.download = true;
+ fonts.fontconfig = {
+ subpixelRendering = "rgb";
+ hinting = "none";
+ };
+ gtk.gtk3.bookmarks = [
+ "file:///home/timmy/docs/src/sites/admin Admin"
+ "file:///media/chexx/chexx cHEXx"
+ ];
+ };
+ home-manager.users.guest = {
+ gtk.gtk3.bookmarks = [
+ "file:///media/chexx/chexx cHEXx"
+ ];
+ fonts.fontconfig = {
+ subpixelRendering = "rgb";
+ hinting = "none";
+ };
+ home.stateVersion = "26.05";
+ };
+
+ system.stateVersion = "24.11";
+}
diff --git a/hosts/office-precision/g610.nix b/hosts/office-precision/g610.nix
new file mode 100644
index 0000000..8cceafc
--- /dev/null
+++ b/hosts/office-precision/g610.nix
@@ -0,0 +1,9 @@
+{ pkgs, ... }: {
+ # Turn off backlight on my G610 keyboard
+ systemd.services.G610DisableBacklight = {
+ description = "G610 disable backlight";
+ wantedBy = [ "multi-user.target" ];
+
+ serviceConfig.ExecStart = "${pkgs.g810-led}/bin/g610-led -a 00";
+ };
+}
diff --git a/modules/hosts/hp-envy-office/hardware-configuration.nix b/hosts/office-precision/hardware-configuration.nix
index 22a8c24..22a8c24 100644
--- a/modules/hosts/hp-envy-office/hardware-configuration.nix
+++ b/hosts/office-precision/hardware-configuration.nix
diff --git a/hosts/office-precision/resources/secrets/wg.yaml b/hosts/office-precision/resources/secrets/wg.yaml
new file mode 100644
index 0000000..f3b53aa
--- /dev/null
+++ b/hosts/office-precision/resources/secrets/wg.yaml
@@ -0,0 +1,16 @@
+wg1: ENC[AES256_GCM,data:XWdnE2QvfvFlMKUW6BoUSsEXDmYj4aNfbxvA6pFeIZM7NEtIwC4/NsplPwFIZwF372/bwDGXGocuh5gd1p/eAlsyz2DrAS+8g1+4T40EPPmXPgh++vUTvcpPlt74Qxp2yAeEU4CU7UPLvlxSvNjh5PGS68Cw7KxSB7kiWFxRWtm5oVfb+U6cBaQE6Biie7wPmXNWOobGHTfFYDeNmH6w33nH4lCV2MC0eYty9ytwHeVS7gUNrk4oxIfd+1FmNzwNHtVZvRg4wRzcc2M9fD0LuyuY6QVS/qaJG4hNNEHZ6qa0VMTnOzQ4jFHtd5jnz2vb7ckE7UWcFPjXYObcykk0End7sHVN/bD+fUv56JKZOHvVYFgs6OwCzUPAufnv10+h,iv:LMEpZW3mwGuIpJoacBYL8M0ROVNeVMzeb7ncZtfxIDA=,tag:aNCziN9CVgm0IB8VvVorEA==,type:str]
+sops:
+ age:
+ - recipient: age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
+ enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBhdUJRS21FeFlseWJXU1dt
+ MnhQRnFvZWM0M1o4bUhBWW9KRDdnZ1pGZkYwCnhPYmFHZmdnRS9lb2xsTXZBcmIx
+ dHF5dmlrbjJyUk84QVBLTEFwMWdESGMKLS0tIHFyZGpSeTFoNEQyZThFc2RyQkhY
+ Q1ZvODVWSXE1STlkZ09tVXdVeU1WaVkKhKMfJclNgHXN7pww2w3AaKwcWiBo676g
+ RWSkV6C+5purA0CzTu1uC3CKz8UK8mVgPfamSZdZQU8+6bGMmseWoQ==
+ -----END AGE ENCRYPTED FILE-----
+ lastmodified: "2026-03-31T19:32:51Z"
+ mac: ENC[AES256_GCM,data:zpEYjHqta6HuRHIKijbLmAND5mCaR14ZUdEeXq/zJ8g4DgWrAkaukhYdXhLH+SEUZt8d3tmj5Eq+6oz9qEjdWhBuPykxVBmBiqIhQBgACCMhSL5v3wY1rxL2ZiQ7szEuwh0GjXpkzPno0Z2+xZ6FzVsJdGnZwykru+JWQcUIfvk=,iv:yUiP/clvI/NnDrji9eMYiTqtO1xsTc7u86V/nlQSMIA=,tag:UyMz/BdYoGxXCJIb8tITcQ==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.12.1
diff --git a/hosts/office-precision/wg.nix b/hosts/office-precision/wg.nix
new file mode 100644
index 0000000..97a5239
--- /dev/null
+++ b/hosts/office-precision/wg.nix
@@ -0,0 +1,8 @@
+{ config, pkgs, inputs, ... }: {
+ sops.secrets.wg1.sopsFile = ./resources/secrets/wg.yaml;
+
+ networking.wg-quick.interfaces = {
+ wg1.configFile = config.sops.secrets.wg1.path;
+ wg1.autostart = false;
+ };
+}
diff --git a/hosts/optiplex/configuration.nix b/hosts/optiplex/configuration.nix
new file mode 100644
index 0000000..cef632e
--- /dev/null
+++ b/hosts/optiplex/configuration.nix
@@ -0,0 +1,111 @@
+{ config, lib, pkgs, home-manager, ... }: {
+ # Setup bootloader
+ boot._loader.enable = true;
+
+ # Enable common options
+ _archetypes = {
+ profiles = {
+ desktop = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ btrfs.enable = true;
+ };
+ collections = {
+ desktop = {
+ extraUtilities.enable = true;
+ cad.enable = true;
+ chromium.enable = true;
+ crypto.enable = true;
+ graphics.enable = true;
+ office.enable = true;
+ video.enable = true;
+ };
+ development = {
+ android.enable = true;
+ c.enable = true;
+ docker.enable = true;
+ lua.enable = true;
+ web = {
+ hugo = {
+ enable = true;
+ openFirewall = true;
+ };
+ node.enable = true;
+ };
+ };
+ virtualization.enable = true;
+ };
+ };
+
+ # Enable user timmy
+ _users.timmy = {
+ enable = true;
+ autologin.enable = true;
+ nas = {
+ enable = true;
+ home.enable = true;
+ home.automount = true;
+ };
+ };
+
+ # Disable suspend
+ systemd._suspend.disable = true;
+
+ # Allow unfree for nvidia + others
+ nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
+ "blackmagic-desktop-video"
+ "decklink"
+ "nvidia-kernel-modules"
+ "nvidia-settings"
+ "nvidia-x11"
+ "spotify"
+ "steam"
+ "steam-original"
+ "steam-run"
+ "steam-unwrapped"
+ ];
+
+ # Install more software
+ environment.systemPackages = with pkgs; [
+ prismlauncher
+ spotify
+ #vintagestory
+ ];
+
+ programs.steam.enable = true;
+
+ # Use nvidia driver
+ services.xserver.videoDrivers = [ "nvidia" ];
+ hardware.nvidia = {
+ modesetting.enable = true; # Required
+ powerManagement.enable = false; # Can cause bugs
+ powerManagement.finegrained = false; # Only works on turing and newer
+ nvidiaSettings = true;
+ open = false; # Not compatible w/ GTX-1050
+ package = config.boot.kernelPackages.nvidiaPackages.legacy_580;
+ forceFullCompositionPipeline = true; # Enables vsync
+ };
+
+ # Enable decklink support for intensity pro
+ services._decklink.enable = true;
+ services._decklink.decklinkSupport.enable = true;
+
+ # Configure home
+ home-manager.users.timmy = {
+ gtk._mintTheme = {
+ dark = true;
+ color = "Green";
+ icons.color = "Green";
+ };
+ programs._seasonalwallpaper.wallpapers.download = true;
+ fonts.fontconfig = {
+ subpixelRendering = "rgb";
+ hinting = "none";
+ };
+ # Enable open-bamboo-networking plugin for OrcaSlicer
+ programs.openBambooNetworking.enable = true;
+ };
+
+ system.stateVersion = "25.11";
+}
diff --git a/hosts/optiplex/hardware-configuration.nix b/hosts/optiplex/hardware-configuration.nix
new file mode 100644
index 0000000..9485a66
--- /dev/null
+++ b/hosts/optiplex/hardware-configuration.nix
@@ -0,0 +1,44 @@
+# 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" "ahci" "nvme" "firewire_ohci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/e4094dd8-d1fd-4aa1-8f95-82a9144a32be";
+ fsType = "btrfs";
+ options = [ "subvol=root" ];
+ };
+
+ fileSystems."/home" =
+ { device = "/dev/disk/by-uuid/e4094dd8-d1fd-4aa1-8f95-82a9144a32be";
+ fsType = "btrfs";
+ options = [ "subvol=home" ];
+ };
+
+ fileSystems."/nix" =
+ { device = "/dev/disk/by-uuid/e4094dd8-d1fd-4aa1-8f95-82a9144a32be";
+ fsType = "btrfs";
+ options = [ "subvol=nix" ];
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/9350-1411";
+ fsType = "vfat";
+ options = [ "fmask=0022" "dmask=0022" ];
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/hosts/piframe/configuration.nix b/hosts/piframe/configuration.nix
new file mode 100644
index 0000000..b45a293
--- /dev/null
+++ b/hosts/piframe/configuration.nix
@@ -0,0 +1,77 @@
+{ config, lib, pkgs, ... }: {
+ _archetypes = {
+ # Use headless and pi profiles
+ profiles.headless = {
+ enable = true;
+ home.users.timmy.enable = true;
+ home.users.piframe.enable = true;
+ };
+ profiles.pi = {
+ enable = true;
+ home.users.timmy.enable = true;
+ home.users.piframe.enable = true;
+ };
+ collections = {
+ desktop.xserver.enable = true;
+ };
+ };
+
+ # Install twm as basic window manager to boot into and immediately go fullscreen on immich-frame
+ services.xserver.windowManager.twm.enable = true;
+
+ # Install immich-frame
+ environment.systemPackages = with pkgs; [
+ immich-frame
+ ];
+
+ # Open 8080 for immich-frame
+ networking.firewall.allowedTCPPorts = [ 8080 ];
+
+ # Enable user timmy for ssh maintenance and wifi secrets
+ _users.timmy = {
+ enable = true;
+ wifi.enable = true;
+ };
+
+ # Enable piframe user
+ users.users.piframe = {
+ isNormalUser = true;
+ };
+
+ # Configure automatic login with getty
+ services.getty.autologinUser = "piframe";
+
+ # Configure piframe home
+ home-manager.users.piframe = {
+ services = {
+ _gammastep.enable = true;
+ # Manual location to avoid having to mess with geoclue
+ gammastep = {
+ provider = "manual";
+ latitude = 41.881832;
+ longitude = -87.623177;
+ };
+ };
+ programs.bash = {
+ enable = true;
+ profileExtra = ''
+ # startx on tty1 immediately
+ [ -z $DISPLAY ] && [ `tty` = /dev/tty1 ] && startx
+ '';
+ };
+ home.file.".xinitrc".text = ''
+ #!/bin/sh
+ gammastep &
+ unclutter --start-hidden &
+ immich-frame --fullscreen &
+ exec twm
+ '';
+ home.file.".twmrc".text = ''
+ *NoTitle # Hide title bar on all windows
+ *NoBorder # Hide borders on all windows
+ '';
+ home.stateVersion = "25.11";
+ };
+
+ system.stateVersion = "25.11";
+}
diff --git a/hosts/piframe/hardware-configuration.nix b/hosts/piframe/hardware-configuration.nix
new file mode 100644
index 0000000..ceb755a
--- /dev/null
+++ b/hosts/piframe/hardware-configuration.nix
@@ -0,0 +1,24 @@
+# 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" "usbhid" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
+ fsType = "ext4";
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
+}
diff --git a/hosts/poweredge-pro/cgit.nix b/hosts/poweredge-pro/cgit.nix
new file mode 100644
index 0000000..6465265
--- /dev/null
+++ b/hosts/poweredge-pro/cgit.nix
@@ -0,0 +1,105 @@
+let
+ publicUrl = "git.tjkeller.xyz";
+ rootTitle = "git.TJKeller.xyz";
+ rootDesc = "TJK's git repositories, served by cgit";
+ scanPath = "/srv/git";
+ sectionFromStartpath = 0;
+ maxRepoCount = 100;
+in {
+
+ containers.cgit = {
+ autoStart = true;
+ privateNetwork = true;
+ ephemeral = true;
+ hostBridge = "br-lan1";
+ localMacAddress = "02:00:00:00:77:08";
+
+ bindMounts = {
+ ${scanPath} = {
+ hostPath = "/nix/persist/cgit/srv/git";
+ isReadOnly = false;
+ };
+ };
+
+ config = { pkgs, lib, config, ... }: {
+ # Networking
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ 80 22 9418 ]; # nginx, ssh, git-daemon
+
+ # Enable ssh service
+ services.openssh.enable = true;
+
+ # Create git user for ssh access
+ # git user and group are uid/gid 41 as defined by gitDaemon & nixpkgs/nixos/modules/misc/ids.nix
+ users.users.git = {
+ isSystemUser = true;
+ group = "git";
+ home = scanPath; # Serve from git user's home to allow cloning git@cgit:repo
+ createHome = true;
+ homeMode = "750"; # Allow read permissions for group members
+ shell = pkgs.bash;
+ #openssh = { inherit authorizedKeys; };
+ };
+ users.groups.git.members = [ "nginx" ]; # Create the git group and add nginx user as a member so scanPath can be served by cgit
+
+ # Enable cgit service
+ services.cgit.main = {
+ enable = true;
+ inherit scanPath;
+ nginx.virtualHost = "cgit";
+ user = "git";
+ group = "git";
+ gitHttpBackend.checkExportOkFiles = true; # only serve repos containing git-daemon-export-ok
+ settings = {
+ # Based on joseluisq/alpine-cgit
+ root-title = rootTitle;
+ root-desc = rootDesc;
+
+ source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py";
+ about-filter = "${pkgs.cgit}/lib/cgit/filters/about-formatting.sh";
+
+ readme = [ ":README" ":README.html" ":README.md" ":README.txt" ];
+
+ # Cache
+ #cache-root=/var/cache/cgit
+ #cache-size=2000
+
+ enable-index-links = 1;
+ enable-index-owner = 0;
+ enable-remote-branches = 1;
+ enable-log-filecount = 1;
+ enable-log-linecount = 1;
+ enable-git-config = 1;
+ snapshots = "tar.xz zip";
+
+ robots = "noindex, nofollow";
+
+ virtual-root = "/";
+ section-from-path = sectionFromStartpath;
+ max-repo-count = maxRepoCount;
+
+ clone-prefix = "https://${publicUrl} git://${publicUrl}";
+ max-stats = "month";
+
+ enable-http-clone = false; # optional: let git-http-backend handle all clones
+ strict-export = "git-daemon-export-ok";
+ };
+ };
+ services.nginx.virtualHosts."cgit".default = true;
+
+ # Enable git program
+ programs.git.enable = true;
+
+ # Enable git daemon
+ services.gitDaemon = {
+ enable = true;
+ basePath = scanPath;
+ exportAll = false; # only export repos containing git-daemon-export-ok
+ listenAddress = "0.0.0.0";
+ port = 9418;
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge-pro/configuration.nix b/hosts/poweredge-pro/configuration.nix
new file mode 100644
index 0000000..f3ea1fb
--- /dev/null
+++ b/hosts/poweredge-pro/configuration.nix
@@ -0,0 +1,62 @@
+{ config, lib, pkgs, ... }: {
+ imports = [
+ ./cgit.nix
+ ./dns.nix
+ ./embedtube.nix
+ ./filebrowser.nix
+ ./fileshares.nix
+ ./key.nix
+ ./networking.nix
+ ./searxng.nix
+ ];
+
+ # Setup bootloader
+ boot._loader.enable = true;
+
+ # Enable common options
+ _archetypes = {
+ profiles = {
+ headless = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ zfs.enable = true;
+ #cuda.enable = true;
+ };
+ collections = {
+ virtualization.enable = true;
+ development.docker.enable = true;
+ };
+ };
+
+ # Import zfs pools
+ boot.zfs.extraPools = [ "VMDisk" "Storage" ];
+
+ # Workaround for docker + libvirt bug
+ systemd.services.bridge-nf-off = {
+ description = "Keep bridged VM traffic out of the IP netfilter path";
+ after = [ "docker.service" ];
+ partOf = [ "docker.service" ];
+ wantedBy = [ "multi-user.target" "docker.service" ];
+ serviceConfig = {
+ Type = "oneshot";
+ RemainAfterExit = true;
+ };
+ script = ''
+ ${pkgs.kmod}/bin/modprobe br_netfilter 2>/dev/null || true
+ for k in iptables ip6tables arptables; do
+ echo 0 > /proc/sys/net/bridge/bridge-nf-call-$k 2>/dev/null || true
+ done
+ '';
+ };
+
+ networking.firewall.checkReversePath = "loose";
+
+ # Enable user timmy
+ _users.timmy.enable = true;
+
+ # Without this, "ZFS requires networking.hostId to be set" will be raised
+ networking.hostId = "2c7d6b03";
+
+ system.stateVersion = "26.05";
+}
diff --git a/hosts/poweredge-pro/dhcp-hosts.nix b/hosts/poweredge-pro/dhcp-hosts.nix
new file mode 100644
index 0000000..08e3ebd
--- /dev/null
+++ b/hosts/poweredge-pro/dhcp-hosts.nix
@@ -0,0 +1,29 @@
+let
+ localResolution.localDomain = "pls.lan";
+ dhcp = {
+ inherit staticLeases;
+ defaultGateway = "192.168.77.1";
+ localhostIp = "192.168.77.2";
+ rangeStart = "192.168.77.50";
+ rangeEnd = "192.168.77.250";
+ };
+ staticLeases = {
+ devel = { macAddress = "00:a0:98:79:81:5a"; staticIp = "192.168.77.3"; };
+ mailcow = { macAddress = "00:a0:98:79:20:a2"; staticIp = "192.168.77.7"; };
+ tjkeller = { macAddress = "00:a0:98:62:cf:86"; staticIp = "192.168.77.8"; };
+ cgit = { macAddress = "02:00:00:00:77:08"; staticIp = "192.168.77.88"; };
+ filebrowser = { macAddress = "02:00:00:00:77:12"; staticIp = "192.168.77.12"; };
+ searxng = { macAddress = "02:00:00:00:77:13"; staticIp = "192.168.77.13"; };
+ embedtube = { macAddress = "02:00:00:00:77:14"; staticIp = "192.168.77.14"; };
+ WIN-BGBGC27B1PF = { macAddress = "d8:9e:f3:1c:f0:1c"; staticIp = "192.168.77.30"; }; # DACS
+ DESKTOP-CQ4UIF9 = { macAddress = "08:bf:b8:3f:bd:48"; staticIp = "192.168.77.31"; }; # Kyle
+ WIN-6FVMAFOID4G = { macAddress = "00:a0:98:58:10:85"; staticIp = "192.168.77.33"; }; # QB
+ office-precision = { macAddress = "48:4d:7e:f8:96:47"; staticIp = "192.168.77.34"; };
+ XRX9C934E85D0A3 = { macAddress = "9c:93:4e:85:d0:a3"; staticIp = "192.168.77.40"; }; # Xerox
+ nvr = { macAddress = "98:8b:0a:cf:4f:5e"; staticIp = "192.168.77.176"; };
+ };
+in {
+ services._router.dnsDhcpConfig = {
+ inherit localResolution dhcp;
+ };
+}
diff --git a/hosts/poweredge-pro/dns-overrides.nix b/hosts/poweredge-pro/dns-overrides.nix
new file mode 100644
index 0000000..887eac2
--- /dev/null
+++ b/hosts/poweredge-pro/dns-overrides.nix
@@ -0,0 +1,12 @@
+let
+ dns.overrides.records = {
+ "docs.chexx.net" = { recordType = "A"; value = "192.168.77.3"; };
+ "files.chexx.net" = { recordType = "A"; value = "192.168.77.3"; };
+ "vault.chexx.net" = { recordType = "A"; value = "192.168.77.3"; };
+ "wg-easy.chexx.net" = { recordType = "A"; value = "192.168.77.3"; };
+ };
+in {
+ services._router.dnsDhcpConfig = {
+ inherit dns;
+ };
+}
diff --git a/hosts/poweredge-pro/dns.nix b/hosts/poweredge-pro/dns.nix
new file mode 100644
index 0000000..511f9e2
--- /dev/null
+++ b/hosts/poweredge-pro/dns.nix
@@ -0,0 +1,57 @@
+{ pkgs, config, ... }: {
+ networking.nameservers = [ "192.168.77.2" ];
+
+ # Router container
+ containers.dnsdhcp = {
+ autoStart = true;
+ ephemeral = true;
+ privateNetwork = true;
+ hostBridge = "br-lan1";
+ #hostBridge = "br-lan1";
+ #localMacAddress = "02:00:00:00:77:01";
+
+ config = { lib, config, ... }: {
+ imports = [
+ ../../nixos/services/router
+ #./router-hosts.nix # Contains dhcp config + static leases + overrides
+ ./dhcp-hosts.nix
+ ./dns-overrides.nix
+ ];
+
+ # Network
+ networking = {
+ enableIPv6 = false;
+ defaultGateway = "192.168.77.1";
+ interfaces.eth0.ipv4.addresses = [{
+ address = "192.168.77.2";
+ prefixLength = 24;
+ }];
+ firewall = {
+ # DNS+DHCP ports
+ allowedTCPPorts = [ 53 ];
+ allowedUDPPorts = [ 53 67 ];
+ };
+ };
+
+ # Setup dns server
+ services._router = {
+ dnsDhcpConfig = {
+ enable = true;
+ #localResolution = {
+ # localDomain = "pls.lan";
+ # localDnsAddress = "192.168.77.1@53";
+ # localReverseZone = "77.168.192.in-addr.arpa";
+ #};
+ };
+ routing.enable = false;
+ };
+
+ services.unbound._blocklists = {
+ enable = true;
+ hageziBlocklists = [ "pro" "nsfw" ];
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge-pro/embedtube.nix b/hosts/poweredge-pro/embedtube.nix
new file mode 100644
index 0000000..12d375e
--- /dev/null
+++ b/hosts/poweredge-pro/embedtube.nix
@@ -0,0 +1,43 @@
+{ config, pkgs, inputs, ... }: {
+ # Secrets
+ sops.secrets.embedtube-api-key = { sopsFile = ./resources/secrets/embedtube.yaml; key = "api-key"; };
+
+ # Container
+ containers.embedtube = {
+ autoStart = true;
+ privateNetwork = true;
+ ephemeral = true;
+ hostBridge = "br-lan1";
+ localMacAddress = "02:00:00:00:77:14";
+
+ bindMounts."/run/secrets/api-key" = {
+ hostPath = config.sops.secrets.embedtube-api-key.path;
+ isReadOnly = true;
+ };
+
+ config = { lib, pkg, config, ... }: {
+ # Import EmbedTube flake input
+ imports = [ inputs.embedtube.nixosModules.default ];
+
+ # Network
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ 80 ]; # Caddy (private + public)
+
+ # EmbedTube
+ services.embedtube = {
+ enable = true;
+ apiKeyFile = "/run/secrets/api-key";
+ };
+
+ # Reverse proxy
+ services.caddy = {
+ enable = true;
+ virtualHosts.":80".extraConfig = ''
+ reverse_proxy localhost:8080
+ '';
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge-pro/filebrowser.nix b/hosts/poweredge-pro/filebrowser.nix
new file mode 100644
index 0000000..4c63af3
--- /dev/null
+++ b/hosts/poweredge-pro/filebrowser.nix
@@ -0,0 +1,55 @@
+{ pkgs, ... }: {
+ containers.filebrowser = {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan1";
+ localMacAddress = "02:00:00:00:77:12";
+
+ # Host path
+ bindMounts = {
+ "/var/lib/filebrowser/data/chexx" = {
+ hostPath = "/VMDisk/shares/chexx";
+ isReadOnly = true;
+ };
+ "/var/lib/filebrowser/data/Scans" = {
+ hostPath = "/VMDisk/shares/scans/";
+ isReadOnly = true;
+ };
+ };
+
+ config = { lib, pkg, config, ... }: let
+ publicPort = 9000;
+ in {
+ # Network
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ 80 publicPort ]; # Caddy (private + public)
+
+ # Filebrowser
+ services.filebrowser = {
+ enable = true;
+ #package = pkgs.filebrowser-quantum; # Not supported yet
+ };
+
+ # Reverse proxy
+ services.caddy = {
+ enable = true;
+ # Private
+ virtualHosts.":80".extraConfig = ''
+ reverse_proxy localhost:8080
+ '';
+ # Public (not sure why toString is needed but ok)
+ virtualHosts.":${toString publicPort}".extraConfig = ''
+ @shared {
+ path /share/*
+ path /static/*
+ path /api/public/*
+ }
+
+ reverse_proxy @shared localhost:8080
+ '';
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge-pro/fileshares.nix b/hosts/poweredge-pro/fileshares.nix
new file mode 100644
index 0000000..65ce84d
--- /dev/null
+++ b/hosts/poweredge-pro/fileshares.nix
@@ -0,0 +1,92 @@
+{ pkgs, config, ... }: {
+ # Configure services
+ services._fileShares = {
+ enable = true;
+ smb.openFirewall = true;
+ smb.enableUnixPasswordSync = true;
+ nfs.openFirewall = true;
+ };
+
+ # Configure share groups
+ users.groups.chexx.gid = 3000;
+ users.groups.scans.gid = 3003;
+
+ # Shares
+ services._fileShares.shares = {
+ chexx = {
+ path = "/VMDisk/shares/chexx";
+ smb = {
+ enable = true;
+ allowGroup = "chexx";
+ defaultFileMask = "0664";
+ defaultDirectoryMask = "0775";
+ };
+ nfs.enable = true;
+ };
+ scans = {
+ path = "/VMDisk/shares/scans";
+ smb = {
+ enable = true;
+ allowGroup = "scans";
+ defaultFileMask = "0664";
+ defaultDirectoryMask = "0775";
+ };
+ nfs.enable = true;
+ };
+ dacs = {
+ path = "/Storage/Users/Dacs";
+ smb = {
+ enable = true;
+ allowUser = "dacs";
+ };
+ };
+ tk = {
+ path = "/home/timmy/docs/shared";
+ nfs.enable = true;
+ };
+ };
+
+ # Configure password secrets for users
+ sops.secrets.smb-initial-pass = { sopsFile = ./resources/secrets/initial-pass.yaml; key = "smb-initial-pass"; };
+ sops.secrets.user-hashed-pass = { sopsFile = ./resources/secrets/initial-pass.yaml; key = "user-hashed-pass"; };
+
+ # Configure users
+ users.users.timmy.extraGroups = [ "chexx" "scans" ];
+ users.users.dacs = {
+ enable = true;
+ isNormalUser = true;
+ extraGroups = [ "chexx" "scans" ];
+ hashedPasswordFile = config.sops.secrets.user-hashed-pass.path;
+ uid = 3001;
+ };
+ users.users.kyle = {
+ enable = true;
+ isNormalUser = true;
+ extraGroups = [ "chexx" "scans" ];
+ hashedPasswordFile = config.sops.secrets.user-hashed-pass.path;
+ uid = 3002;
+ };
+ users.users.scanner = {
+ enable = true;
+ isSystemUser = true;
+ group = "scans";
+ hashedPasswordFile = config.sops.secrets.user-hashed-pass.path;
+ uid = 3003;
+ };
+ users.users.zfsbackup = {
+ isSystemUser = true;
+ group = "zfsbackup";
+ shell = pkgs.bashInteractive;
+ hashedPassword = "!"; # Disallow login through standard means
+ openssh.authorizedKeys.keyFiles = [ ./resources/openssh/zfsbackup/truenas-10.0.0.9-rsa.pub ];
+ };
+ users.groups.zfsbackup = {};
+
+ # Configure user enrollment for samba
+ services._fileShares.smb.enrollUsers = {
+ timmy = { enable = true; passwordFile = config.sops.secrets.smb-initial-pass.path; };
+ dacs = { enable = true; passwordFile = config.sops.secrets.smb-initial-pass.path; };
+ kyle = { enable = true; passwordFile = config.sops.secrets.smb-initial-pass.path; };
+ scanner = { enable = true; passwordFile = config.sops.secrets.smb-initial-pass.path; };
+ };
+}
diff --git a/hosts/poweredge-pro/hardware-configuration.nix b/hosts/poweredge-pro/hardware-configuration.nix
new file mode 100644
index 0000000..e41dec5
--- /dev/null
+++ b/hosts/poweredge-pro/hardware-configuration.nix
@@ -0,0 +1,50 @@
+# 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 = [ "ahci" "ehci_pci" "megaraid_sas" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "nixos/root";
+ fsType = "zfs";
+ options = [ "zfsutil" ];
+ };
+
+ fileSystems."/nix" =
+ { device = "nixos/nix";
+ fsType = "zfs";
+ options = [ "zfsutil" ];
+ };
+
+ fileSystems."/var" =
+ { device = "nixos/var";
+ fsType = "zfs";
+ options = [ "zfsutil" ];
+ };
+
+ fileSystems."/home" =
+ { device = "nixos/home";
+ fsType = "zfs";
+ options = [ "zfsutil" ];
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/2096-A1E5";
+ fsType = "vfat";
+ options = [ "fmask=0022" "dmask=0022" ];
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/hosts/poweredge-pro/key.nix b/hosts/poweredge-pro/key.nix
new file mode 100644
index 0000000..40cd529
--- /dev/null
+++ b/hosts/poweredge-pro/key.nix
@@ -0,0 +1,23 @@
+{ pkgs, ... }: {
+ # Nixos root
+ boot.initrd.systemd.enable = true; # Default since 26.05
+ boot.initrd.supportedFilesystems.ext4 = true;
+
+ boot.initrd.systemd.mounts = [{
+ what = "/dev/disk/by-label/key";
+ where = "/key";
+ type = "ext4";
+ options = "ro";
+ unitConfig.DefaultDependencies = "no";
+ before = [ "zfs-import-nixos.service" ];
+ requiredBy = [ "zfs-import-nixos.service" ];
+ }];
+
+ # Storage
+ sops.secrets."zfs-key-storage" = {
+ sopsFile = ./resources/secrets/zfs-key.yaml;
+ key = "storage";
+ path = "/etc/zfs/keys/storage.key";
+ mode = "0400";
+ };
+}
diff --git a/hosts/poweredge-pro/networking.nix b/hosts/poweredge-pro/networking.nix
new file mode 100644
index 0000000..1debc03
--- /dev/null
+++ b/hosts/poweredge-pro/networking.nix
@@ -0,0 +1,32 @@
+{
+ networking = {
+ useDHCP = false;
+ # Label lan and wan interfaces
+ _interfaceLabels = {
+ enable = true;
+ interfaces.mgmt0 = "44:a8:42:35:b7:09";
+ interfaces.lan0 = "44:a8:42:35:b7:0a";
+ interfaces.wan0 = "44:a8:42:35:b7:0b";
+ interfaces.lan1 = "44:a8:42:35:b7:0c";
+ };
+ # Create bridges
+ bridges = {
+ br-lan0.interfaces = [ "lan0" ];
+ br-wan0.interfaces = [ "wan0" ];
+ br-lan1.interfaces = [ "lan1" ];
+ };
+ interfaces.br-lan0.useDHCP = false;
+ interfaces.br-wan0.useDHCP = false;
+ interfaces.br-lan1.useDHCP = false;
+ # Setup mgmt0
+ interfaces.mgmt0.ipv4.addresses = [{
+ address = "192.168.77.11";
+ prefixLength = 24;
+ }];
+ defaultGateway = "192.168.77.1";
+ nameservers = [ "192.168.77.1" ];
+ # Firewall for vms
+ firewall.interfaces.mgmt0.allowedTCPPorts = [ 5900 5901 ];
+
+ };
+}
diff --git a/hosts/poweredge-pro/resources/openssh/zfsbackup/truenas-10.0.0.9-rsa.pub b/hosts/poweredge-pro/resources/openssh/zfsbackup/truenas-10.0.0.9-rsa.pub
new file mode 100644
index 0000000..d1191b9
--- /dev/null
+++ b/hosts/poweredge-pro/resources/openssh/zfsbackup/truenas-10.0.0.9-rsa.pub
@@ -0,0 +1 @@
+no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQN5nXovLaKk4IaEl9X6hhcKHYtghpfzeqbKAk73EG8rQzfMoOtMU6tzYccF2VQy2LNHn0YcZRx2E/u30L4GK7GcKhPg8GZo3wBacRfD3xSsNw1vqGRmdyDwf0s+HvBdgg+SxoURzyk7MWb6f4YuH6gVP71Sq1ybFs4JwDsDxPVDJ5SRdZj0vmdwelMvGv60cQhTexHyBeYGYdJEq2Bhew88JHdgilP16fMescnbIL0AiisDlvgi0oReZ8046i3+NhFQwIVdYwlNDQ1ANdpsjmm5vrKhg1C2kQXQkRgfoRNWalbyPn1LTMQIcLelj+Y9dRAvymwjRmteekplTJlkoP3kR9kPtLbcWwoVWmkuj+PBfRWyRlvBF7bGiIjagWcn1k3M4LgO7gfrSBHuW7Rd2+2zXvRrsTN1MzOSKoYf6TvOfxDxlAasZVA6kVcnVQvHx+9xbqcJ4JZdA8k6c/cil1u0BT3QxMZ2JHELdHAo026das82Q7YdR4bAR4Ph5GUk8= root@truenas
diff --git a/hosts/poweredge-pro/resources/secrets/embedtube.yaml b/hosts/poweredge-pro/resources/secrets/embedtube.yaml
new file mode 100644
index 0000000..f75d6d5
--- /dev/null
+++ b/hosts/poweredge-pro/resources/secrets/embedtube.yaml
@@ -0,0 +1,16 @@
+api-key: ENC[AES256_GCM,data:F0/EBnAhFeJBMAG/D6gRNPwdsLy3HubjEp/Tw07s3dah+ZhWCC93,iv:nSVrGI11nx0vCtSWGbU2+vtEdQwOBihJWI8oM9sbT0o=,tag:GbsNXalVWarwmENpsFIfkA==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvTXc3S2M5dWVDbnZGRmhM
+ Qmo0SzM4K2tndldCYnlvZkhmYmgrdCtVSW00Cm1TVnAxdEV1V2lRN1Q1ZU5WSFRy
+ OXN1ZjVJMGkyL2JISlNnYURuNDZiblUKLS0tIEo4NXpHZ1BFZ29lZDhnS3RUcVh6
+ eFplVVBBV011SUMwbTdzcHdDODJoQXMKjn9LtU7lK65pHW+Rcbbh8eXZgKnTe3TK
+ ZC/dtyBHc/esp93GiYAqMYRH9+6pfAZNNpko6PFqsVsN6eCzPrh05g==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1q8l3g3t6qjhsmz0gju0n535pz45d2c9crla8jcd5ftjlqe4fs3eqfqay0k
+ lastmodified: "2026-09-22T22:34:40Z"
+ mac: ENC[AES256_GCM,data:7AsRul6ze58dzK00i1eA9fO4alCSXANQNaVb7mkVfcRQLr+llv/6cU1E67LnEDh4r5TMZt2L2zz4duP2uVHQP6lRG5dNUU7b3c7O/DJbLKvT7jDPxJdfPz2XZOFz1+NHCPNdhPkmuPWlIbffiw+yVA9kuS8iJJ8DS2rjTDR2/tE=,iv:rKemvVhEBluw2ZfxwlNVtQW49oLbVKdEHhrQ61e5t0M=,tag:rgCj6PPsZLkpqecPgVJ6Fw==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.13.3
diff --git a/hosts/poweredge-pro/resources/secrets/initial-pass.yaml b/hosts/poweredge-pro/resources/secrets/initial-pass.yaml
new file mode 100644
index 0000000..a25a87d
--- /dev/null
+++ b/hosts/poweredge-pro/resources/secrets/initial-pass.yaml
@@ -0,0 +1,17 @@
+smb-initial-pass: ENC[AES256_GCM,data:+KANYy3NLfBQMA==,iv:sqd5D4wBldOZ5FSjzDLi75JpMMGD7HX//UZr6R9rCjU=,tag:ElnYlqFTjMLdR//7jm405w==,type:str]
+user-hashed-pass: ENC[AES256_GCM,data:YG51p0bCuOt1PslbeX3H9unN6FovZTL9GIZeyf4aPZXlhCdrhH9OOFTMOWRskQqyWShwATO5HY/XYzP5mVk+ljvMumK5OEsBYg==,iv:6Z6DKB0cBHt+rbW6t0nrj3uFhIdJzcMZX3Qt1FZpvdw=,tag:+I2Kui+oa9wv91CpLOo1yw==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvUzN0VDA3cGJteHJsTUp1
+ U1Z6aFA1R2hMcnIxTE8rWkZEWTVWbmtlU0FFCldIdU5CYU5FS3p0QXYyczd6TmhM
+ alRkZUJJeVduWEtON1ZBWWk2ajgxUTAKLS0tIFM2V3hZNE95cUJ5bkF2WERZVEtQ
+ VWwvN3dYSzRreTY1dUF5ejY2N1BCWlkKX1OT8zm4wu5q0uLE4htS2HJzndOHLBHe
+ WK1XBlFQOa54oB29ehcE/1j0LtXUenAbqTTAHTsmTkokxyVemaZAjA==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1q8l3g3t6qjhsmz0gju0n535pz45d2c9crla8jcd5ftjlqe4fs3eqfqay0k
+ lastmodified: "2026-08-24T23:01:03Z"
+ mac: ENC[AES256_GCM,data:ODXwdFn0d8z9hcdCKoXeWCpJLyWF6QnVfkGDCE1pO23K3YHTqn7qGWYiuichJLMlfUNBdm7HuXvkuSoteua6qAiL9Us+r3vjpW8hIVZDrcja+EVHzweMgUEb66nrLwtIbDIx6nr8Bec2KcQ6dYJiJ7we3jyrXGFaJQ4wtRpRvmU=,iv:TOZkTVV5Nq/5IsRuv0Gr7yrB51busEAUkKSgQO83u00=,tag:Kk/01O6iqgiaHRFcwfhdtA==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.13.3
diff --git a/hosts/poweredge-pro/resources/secrets/zfs-key.yaml b/hosts/poweredge-pro/resources/secrets/zfs-key.yaml
new file mode 100644
index 0000000..20496b5
--- /dev/null
+++ b/hosts/poweredge-pro/resources/secrets/zfs-key.yaml
@@ -0,0 +1,16 @@
+storage: ENC[AES256_GCM,data:AnjXAapH0ClmXjKQCBoVtIijDIxSBVhjHXEMa7Y9RgXWQ7bfRtx3oDZIYgwLQMohr3NUu8Bj9PZ//4g6SKKCgA==,iv:OEFfEceYShoiHUoY+Q0jpPYEA6vWlLZMXVHd52gp0GI=,tag:GDnrorkbDUOLmcZeiuc9YA==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSByL21EZUdwZkR5K3JVVWc4
+ Sk5XRGFpSWtsWTNSVjN6cERKcDBibnZ1Z3pjCjU1S1JNcFFSakJHMnhwQ3BhcGI5
+ Tzg4R2hneHNYNmF0c1EvYkVDY3RYWkUKLS0tIHlaWHRPeXhXK05MMnJ5bzlLWUds
+ eGZkTlFYT2JtSVRnWm4wcXJ2RFcrd1UKFZNppEmn0TvF5/w32rZLXwaR/WfZyrZ+
+ d6IF1lNA1407phjt+SWsIcRpTQwcY7vdAv4Ozk8tW7LqM+T4xMVLkQ==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1q8l3g3t6qjhsmz0gju0n535pz45d2c9crla8jcd5ftjlqe4fs3eqfqay0k
+ lastmodified: "2026-08-23T03:15:49Z"
+ mac: ENC[AES256_GCM,data:2/UdlNsj3+oihVfgalj8DfFN1XWyY14x0/H3ydDXT6rJgjuFMPwjpNCFuzRP4mT99a46HGl74INfuKXNyFPXMW+eKG81vVHZgDsoipQwI8yUveyCfGezdIz4Rab5fTzXXrvXaXhIdovqDuCUj2FCaqosFvCPC0AtDVqoHuHlU8k=,iv:aBez26rU/252xYkpBVqv8ZrO2vhQm0RJJo/H7puGHQ4=,tag:NRSyINDS4wNF8g2hVRk6Xw==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.13.3
diff --git a/hosts/poweredge-pro/searxng.nix b/hosts/poweredge-pro/searxng.nix
new file mode 100644
index 0000000..c05af03
--- /dev/null
+++ b/hosts/poweredge-pro/searxng.nix
@@ -0,0 +1,179 @@
+{ pkgs, ... }: {
+ containers.searxng = {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:77:13";
+
+ config = { lib, config, ... }: let
+ environmentFile = "/run/searx/searxng.env";
+ generateEnvironmentFile = ''
+ umask 077
+ echo "SEARXNG_SECRET=$(head -c 56 /dev/urandom | base64)" > ${environmentFile}
+ ls /run/searx
+ '';
+ in {
+ # Network
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ 80 ]; # Nginx
+
+ # Generate secret key
+ systemd.services.searx-environment-file = {
+ description = "Generate environment file with secret key for searx";
+ wantedBy = [ "searx-init.service" ];
+ partOf = [ "searx-init.service" ];
+ before = [ "searx-init.service" ];
+ serviceConfig = {
+ Type = "oneshot";
+ RemainAfterExit = true;
+ User = "searx";
+ RuntimeDirectory = "searx";
+ RuntimeDirectoryMode = "750";
+ ConditionPathExists = "!${environmentFile}";
+ };
+ script = generateEnvironmentFile;
+ };
+
+ # Configure searxng
+ services.searx = {
+ enable = true;
+ redisCreateLocally = true;
+ #package = pkgs.unstable.searxng;
+ package = pkgs.searxng;
+ inherit environmentFile; # Provides secret key
+
+ # Rate limiting
+ limiterSettings = {
+ real_ip = {
+ x_for = 1;
+ ipv4_prefix = 32;
+ ipv6_prefix = 56;
+ };
+
+ botdetection = {
+ ip_limit = {
+ filter_link_local = true;
+ link_token = true;
+ };
+ };
+ };
+
+ # UWSGI configuration
+ configureUwsgi = true;
+
+ uwsgiConfig = {
+ socket = "/run/searx/searx.sock";
+ http = "127.0.0.1:8888";
+ chmod-socket = "660";
+ };
+
+ settings = {
+ general = {
+ instance_name = "TJK Search";
+ donation_url = "https://tjkeller.xyz";
+ enable_metrics = false;
+ };
+
+ ui = {
+ static_use_hash = true;
+ default_locale = "en";
+ query_in_title = true;
+ infinite_scroll = false;
+ center_alignment = true;
+ hotkeys = "vim";
+ };
+
+ server = {
+ port = 8888;
+ bind_address = "127.0.0.1";
+ method = "GET";
+ secret_key = "@SEARX_SECRET_KEY@"; # Reference external secret key
+ limiter = true;
+ };
+
+ # Search engine settings
+ search = {
+ safe_search = 2; # Strict
+ autocomplete = "";
+ default_lang = "en-US";
+ };
+
+ preferences.lock = [ "safesearch" ]; # Lock safe_search at strict
+
+ # https://docs.searxng.org/admin/plugins.html
+ enabled_plugins = [
+ "Tor check plugin"
+ "Tracker URL remover"
+ "Basic Calculator"
+ "Unit converter plugin"
+ "Hash plugin"
+ "Self Information"
+ "Open Access DOI rewrite"
+ "Hostnames plugin"
+ ];
+
+ hostnames.replace = {
+ "(.*\.)?youtube\.com$" = "yt.tjkeller.xyz";
+ "(.*\.)?youtu\.be$" = "yt.tjkeller.xyz";
+ #"(.*\.)?reddit\.com$" = "old.reddit.com";
+ };
+
+ # Enable / disabled search engines from default list
+ engines = lib.mapAttrsToList (name: value: { inherit name; disabled = !value; }) {
+ # General
+ "mojeek" = true;
+ "qwant" = true;
+ "bing" = true;
+
+ # Images
+ "artic" = false;
+ "deviantart" = false;
+ "flickr" = false;
+ "library of congress" = false;
+ "openverse" = false;
+ "pinterest" = false;
+ "public domain image archive" = false;
+ "unsplash" = false;
+ "wallhaven" = false;
+ "wikicommons.images" = false;
+
+ # Videos
+ "bitchute" = true;
+ "dailymotion" = false;
+ "piped" = false;
+ "rumble" = true;
+ "sepiasearch" = false;
+ "vimeo" = false;
+ "wikicommons.videos" = false;
+
+ # Music
+ "piped.music" = false;
+
+ # Files
+ "1337x" = true;
+ "annas archive" = true;
+ "library genesis" = true;
+
+ # Apps
+ "fdroid" = true;
+ };
+ };
+ };
+
+ # Nginx configuration
+ users.users.nginx.extraGroups = [ "searx" ]; # Allow access to uwsgi socket with 660 permissions
+ services.nginx = {
+ enable = true;
+ virtualHosts."searx" = {
+ default = true;
+ serverName = "_"; # Catchall
+ locations."/".extraConfig = ''
+ uwsgi_pass unix:${config.services.searx.uwsgiConfig.socket};
+ '';
+ };
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge/bitcoind.nix b/hosts/poweredge/bitcoind.nix
new file mode 100644
index 0000000..17a91f2
--- /dev/null
+++ b/hosts/poweredge/bitcoind.nix
@@ -0,0 +1,42 @@
+{
+ containers.bitcoind = {
+ autoStart = true;
+ ephemeral = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:00:04";
+
+ # Host path
+ bindMounts = {
+ "/var/lib/bitcoind-main" = {
+ hostPath = "/media/ingens/bitcoin";
+ isReadOnly = false;
+ };
+ };
+
+ config = { lib, pkgs, config, ... }: let
+ p2pPort = 8333;
+ rpcPort = 8332;
+ in {
+ # Network
+ networking.enableIPv6 = false;
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ p2pPort rpcPort ];
+
+ # Bitcoin
+ services.bitcoind."main" = {
+ enable = true;
+ port = p2pPort;
+ rpc.port = rpcPort;
+ rpc.users.timmy.passwordHMAC = "7557196eec6e3e062a57b0720abff7cf$617211e94b964f548cfbb5c23590f690c2940e424fffe72485276493f1cb0b29";
+ extraConfig = ''
+ rpcallowip=192.168.1.0/24
+ rpcbind=0.0.0.0
+ upnp=0
+ '';
+ };
+
+ system.stateVersion = "25.11";
+ };
+ };
+}
diff --git a/hosts/poweredge/configuration.nix b/hosts/poweredge/configuration.nix
new file mode 100644
index 0000000..ba93a37
--- /dev/null
+++ b/hosts/poweredge/configuration.nix
@@ -0,0 +1,48 @@
+{ config, lib, pkgs, ... }: {
+ imports = [
+ ./bitcoind.nix
+ ./ddns-updater.nix
+ ./filebrowser.nix
+ ./fileshares.nix
+ ./gitea.nix
+ ./immich.nix
+ ./jellyfin.nix
+ ./metrics.nix
+ ./navidrome.nix
+ ./networking.nix
+ ./nvidia.nix
+ ./transmission.nix
+ ./vpn-router.nix
+ ./slskd.nix
+ #./notification-mailer.nix # TODO move some of this stuff to archetype
+ ];
+
+ # Setup bootloader
+ boot._loader.enable = true;
+
+ # Enable common options
+ _archetypes = {
+ profiles = {
+ headless = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ zfs.enable = true;
+ cuda.enable = true;
+ };
+ collections = {
+ music.beets.enable = true;
+ };
+ };
+
+ # Import zfs pools
+ boot.zfs.extraPools = [ "ingens" "memoria" ];
+
+ # Enable user timmy
+ _users.timmy.enable = true;
+
+ # Without this, "ZFS requires networking.hostId to be set" will be raised
+ networking.hostId = "4d9e002f";
+
+ system.stateVersion = "25.11";
+}
diff --git a/hosts/poweredge/ddns-updater.nix b/hosts/poweredge/ddns-updater.nix
new file mode 100644
index 0000000..319e3c4
--- /dev/null
+++ b/hosts/poweredge/ddns-updater.nix
@@ -0,0 +1,22 @@
+{ config, lib, ... }: let
+ credential = "config";
+in {
+ # Config for ddns-updater, owned by the ddns-updater systemd service user
+ sops.secrets.ddns-updater-config.sopsFile = ./resources/secrets/ddns-updater-config.yaml;
+
+ # Load secret as a credential in systemd service
+ systemd.services.ddns-updater.serviceConfig = {
+ LoadCredential = [
+ "${credential}:${config.sops.secrets.ddns-updater-config.path}"
+ ];
+ };
+
+ # Enable ddns updater
+ services.ddns-updater = {
+ enable = true;
+ environment = {
+ SERVER_ENABLED="no";
+ CONFIG_FILEPATH = "%d/${credential}";
+ };
+ };
+}
diff --git a/hosts/poweredge/filebrowser.nix b/hosts/poweredge/filebrowser.nix
new file mode 100644
index 0000000..681a6a6
--- /dev/null
+++ b/hosts/poweredge/filebrowser.nix
@@ -0,0 +1,36 @@
+{
+ containers.filebrowser = {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:00:05";
+
+ # Host path
+ bindMounts = {
+ "/var/lib/filebrowser/data" = {
+ hostPath = "/media";
+ isReadOnly = true;
+ };
+ };
+
+ config = { lib, pkg, config, ... }: {
+ # Network
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ 80 8080 ]; # Caddy + filebrowser
+
+ # Filebrowser
+ services.filebrowser.enable = true;
+ services.filebrowser.settings.address = "0.0.0.0";
+
+ # Reverse proxy
+ services.caddy = {
+ enable = true;
+ virtualHosts.":80".extraConfig = ''
+ reverse_proxy localhost:8080
+ '';
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge/fileshares.nix b/hosts/poweredge/fileshares.nix
new file mode 100644
index 0000000..faf0f83
--- /dev/null
+++ b/hosts/poweredge/fileshares.nix
@@ -0,0 +1,68 @@
+{
+ # Configure services
+ services._fileShares = {
+ enable = true;
+ smb.openFirewall = true;
+ nfs.openFirewall = true;
+ };
+ # Shares
+ services._fileShares.shares = {
+ WinBackups = {
+ path = "/media/ingens/backups/windows";
+ smb.enable = true;
+ };
+ pictures = {
+ path = "/media/ingens/pictures";
+ nfs.enable = true;
+ };
+ tapes = {
+ path = "/media/ingens/tapes";
+ nfs.enable = true;
+ smb.enable = true;
+ };
+ backups = {
+ path = "/media/ingens/backups";
+ nfs.enable = true;
+ };
+ games = {
+ path = "/media/ingens/games";
+ nfs.enable = true;
+ };
+ documents = {
+ path = "/media/ingens/documents";
+ nfs.enable = true;
+ smb.enable = true;
+ };
+ };
+
+ # retro shares
+ containers.retronas = {
+ autoStart = true;
+ bindMounts = {
+ "/media/ingens/games" = {
+ hostPath = "/media/ingens/games";
+ isReadOnly = false;
+ };
+ };
+
+ config = { config, pkgs, ... }: {
+ imports = [ ../../nixos/services/fileshares.nix ]; # Get fileshares module
+
+ services._fileShares = {
+ enable = true;
+ smb = {
+ port = 1445;
+ enableLegacyNT1 = true; # purpose of this container
+ openFirewall = true;
+ };
+ };
+ services._fileShares.shares = {
+ PS2 = {
+ path = "/media/ingens/games/ps2";
+ smb.enable = true;
+ smb.allowGuests = true;
+ };
+ };
+ };
+ };
+}
diff --git a/hosts/poweredge/gitea.nix b/hosts/poweredge/gitea.nix
new file mode 100644
index 0000000..4c800df
--- /dev/null
+++ b/hosts/poweredge/gitea.nix
@@ -0,0 +1,41 @@
+{
+ containers.gitea = {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:00:03";
+
+ # TODO make a mountpoint for git repositories
+
+ config = { lib, pkgs, config, ... }: {
+ # Network
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ 80 22 ]; # Caddy + ssh
+
+ # Gitea
+ services.gitea = {
+ enable = true;
+ #user = "git"; # So ssh cloning uses git@gitea
+ settings = {
+ repository = {
+ ENABLE_PUSH_CREATE_USER = true;
+ ENABLE_PUSH_CREATE_ORG = true;
+ };
+ };
+ };
+
+ # SSH for repositories
+ services.openssh.enable = true;
+
+ # Reverse proxy
+ services.caddy = {
+ enable = true;
+ virtualHosts.":80".extraConfig = ''
+ reverse_proxy localhost:3000
+ '';
+ };
+
+ system.stateVersion = "25.11";
+ };
+ };
+}
diff --git a/hosts/poweredge/hardware-configuration.nix b/hosts/poweredge/hardware-configuration.nix
new file mode 100644
index 0000000..0fcc098
--- /dev/null
+++ b/hosts/poweredge/hardware-configuration.nix
@@ -0,0 +1,50 @@
+# 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" "ahci" "megaraid_sas" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "zpool/root";
+ fsType = "zfs";
+ options = [ "zfsutil" ];
+ };
+
+ fileSystems."/nix" =
+ { device = "zpool/nix";
+ fsType = "zfs";
+ options = [ "zfsutil" ];
+ };
+
+ fileSystems."/var" =
+ { device = "zpool/var";
+ fsType = "zfs";
+ options = [ "zfsutil" ];
+ };
+
+ fileSystems."/home" =
+ { device = "zpool/home";
+ fsType = "zfs";
+ options = [ "zfsutil" ];
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/D083-98C0";
+ fsType = "vfat";
+ options = [ "fmask=0022" "dmask=0022" ];
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/hosts/poweredge/immich.nix b/hosts/poweredge/immich.nix
new file mode 100644
index 0000000..ff0275c
--- /dev/null
+++ b/hosts/poweredge/immich.nix
@@ -0,0 +1,89 @@
+{ pkgs, ... }: let
+ onnxruntimeCuda = pkgs.onnxruntime.override { cudaSupport = true; };
+in {
+ containers.immich = {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:00:01";
+
+ # Host path
+ bindMounts = {
+ "/var/lib/immich" = {
+ hostPath = "/media/ingens/immich";
+ isReadOnly = false;
+ };
+ };
+
+ # GPU
+ allowedDevices = [
+ { node = "/dev/nvidia0"; modifier = "rw"; }
+ { node = "/dev/nvidiactl"; modifier = "rw"; }
+ { node = "/dev/nvidia-uvm"; modifier = "rw"; }
+ { node = "/dev/nvidia-uvm-tools"; modifier = "rw"; }
+ { node = "/dev/nvidia-modeset"; modifier = "rw"; }
+ ];
+
+ bindMounts = {
+ # NVENC/NVDEC - video transcoding
+ "/dev/nvidia0" = { hostPath = "/dev/nvidia0"; isReadOnly = false; };
+ "/dev/nvidiactl" = { hostPath = "/dev/nvidiactl"; isReadOnly = false; };
+ # CUDA - required for ML inference
+ "/dev/nvidia-uvm" = { hostPath = "/dev/nvidia-uvm"; isReadOnly = false; };
+ "/dev/nvidia-uvm-tools" = { hostPath = "/dev/nvidia-uvm-tools"; isReadOnly = false; };
+ # Modeset - needed by some driver paths
+ "/dev/nvidia-modeset" = { hostPath = "/dev/nvidia-modeset"; isReadOnly = false; };
+ };
+
+ config = { lib, config, ... }: {
+ imports = [ ./nvidia.nix ];
+
+ # Network
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ 80 2283 ]; # Caddy + immich
+
+ # Immich
+ services.immich = {
+ enable = true;
+ host = "0.0.0.0";
+ package = pkgs.unstable.immich;
+ accelerationDevices = [
+ "/dev/nvidia0"
+ "/dev/nvidiactl"
+ "/dev/nvidia-uvm"
+ "/dev/nvidia-uvm-tools"
+ "/dev/nvidia-modeset"
+ ];
+
+ # Tell immich-server to use NVENC for transcoding
+ environment = {
+ NVIDIA_VISIBLE_DEVICES = "all";
+ NVIDIA_DRIVER_CAPABILITIES = "compute,video,utility";
+ };
+
+ # Enable the ML microservice with CUDA
+ # FIXME Disabled since the ML service w/ CUDA uses almost all the vram on my gpu
+ machine-learning.enable = false;
+ };
+ environment.systemPackages = with pkgs.unstable; [ immich immich-cli ];
+
+ # TODO IPP is missing a lot of features right now. Check back later
+ ## Immich public proxy
+ #services.immich-public-proxy = {
+ # enable = true;
+ # immichUrl = "http://localhost:2283";
+ # package = pkgs.unstable.immich-public-proxy;
+ #};
+
+ # Reverse proxy
+ services.caddy = {
+ enable = true;
+ virtualHosts.":80".extraConfig = ''
+ reverse_proxy localhost:2283
+ '';
+ };
+
+ system.stateVersion = "25.11";
+ };
+ };
+}
diff --git a/hosts/poweredge/jellyfin.nix b/hosts/poweredge/jellyfin.nix
new file mode 100644
index 0000000..761c3ae
--- /dev/null
+++ b/hosts/poweredge/jellyfin.nix
@@ -0,0 +1,91 @@
+{
+ containers.jellyfin = {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:00:02";
+ bindMounts = {
+ "/media" = {
+ hostPath = "/media/ingens/media";
+ isReadOnly = true;
+ };
+ };
+
+ # GPU
+ allowedDevices = [
+ { node = "/dev/nvidia0"; modifier = "rw"; }
+ { node = "/dev/nvidiactl"; modifier = "rw"; }
+ { node = "/dev/nvidia-uvm"; modifier = "rw"; }
+ { node = "/dev/nvidia-uvm-tools"; modifier = "rw"; }
+ { node = "/dev/nvidia-modeset"; modifier = "rw"; }
+ ];
+
+ bindMounts = {
+ # NVENC/NVDEC - video transcoding
+ "/dev/nvidia0" = { hostPath = "/dev/nvidia0"; isReadOnly = false; };
+ "/dev/nvidiactl" = { hostPath = "/dev/nvidiactl"; isReadOnly = false; };
+ # CUDA - required for ML inference
+ "/dev/nvidia-uvm" = { hostPath = "/dev/nvidia-uvm"; isReadOnly = false; };
+ "/dev/nvidia-uvm-tools" = { hostPath = "/dev/nvidia-uvm-tools"; isReadOnly = false; };
+ # Modeset - needed by some driver paths
+ "/dev/nvidia-modeset" = { hostPath = "/dev/nvidia-modeset"; isReadOnly = false; };
+ };
+
+ config = { lib, config, pkgs, ... }: {
+ imports = [ ./nvidia.nix ];
+
+ # Network
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ 80 ]; # Caddy
+
+ # Jellyfin
+ services.jellyfin = {
+ enable = true;
+ openFirewall = true;
+
+ hardwareAcceleration = {
+ enable = true;
+ type = "nvenc";
+ device = "/dev/nvidia0"; # Required by the module's assertion, unused in encoding.xml for nvenc
+ };
+
+ forceEncodingConfig = true; # Override encoding.xml
+
+ transcoding = {
+ enableHardwareEncoding = true;
+
+ hardwareEncodingCodecs = {
+ hevc = true; # Pascal 4th-gen NVENC supports HEVC 8/10-bit encode
+ av1 = false; # NOT supported on Pascal — do not enable
+ };
+
+ hardwareDecodingCodecs = {
+ h264 = true;
+ hevc = true;
+ hevc10bit = true;
+ vp8 = true;
+ vp9 = true;
+ mpeg2 = true;
+ vc1 = true;
+ av1 = false; # NOT supported on Pascal NVDEC
+ hevcRExt10bit = false; # Range Extensions decode is a newer-gen feature, skip on Pascal
+ hevcRExt12bit = false;
+ };
+
+ encodingPreset = "medium";
+ enableToneMapping = true; # works via CUDA-based tonemap_cuda filter on Pascal+
+ };
+ };
+
+ # Reverse proxy
+ services.caddy = {
+ enable = true;
+ virtualHosts.":80".extraConfig = ''
+ reverse_proxy localhost:8096
+ '';
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge/metrics.nix b/hosts/poweredge/metrics.nix
new file mode 100644
index 0000000..edf3da9
--- /dev/null
+++ b/hosts/poweredge/metrics.nix
@@ -0,0 +1,43 @@
+{ config, inputs, ... }: {
+ imports = [ inputs.telemetry.nixosModules.collectors ];
+
+ services.telemetry.collectors = {
+ enable = true;
+ logs.lokiUrl = "http://metrics:3100"; # The container
+ };
+
+ containers.metrics = {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:00:06";
+ ephemeral = true;
+
+ # The module reads whatever path you point secretKeyFile at.
+ bindMounts = {
+ "/var/lib/prometheus2" = { hostPath = "/nix/persist/metrics/prometheus2"; isReadOnly = false; };
+ "/var/lib/loki" = { hostPath = "/nix/persist/metrics/loki"; isReadOnly = false; };
+ "/var/lib/grafana" = { hostPath = "/nix/persist/metrics/grafana"; isReadOnly = false; };
+ };
+
+ config = { ... }: {
+ imports = [ inputs.telemetry.nixosModules.server ];
+
+ networking.enableIPv6 = false;
+ networking.interfaces.eth0.useDHCP = true;
+
+ services.telemetry.server = {
+ enable = true;
+ collectorHosts = [ "poweredge" ];
+ grafana.generateSecretKey = true;
+ proxy.enable = true;
+ };
+
+ # Pin loki uid+gid
+ users.users.loki = { uid = 3100; group = "loki"; isSystemUser = true; };
+ users.groups.loki.gid = 3100;
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge/navidrome.nix b/hosts/poweredge/navidrome.nix
new file mode 100644
index 0000000..fa40ed4
--- /dev/null
+++ b/hosts/poweredge/navidrome.nix
@@ -0,0 +1,51 @@
+{
+ containers.navidrome = {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:00:08";
+
+ bindMounts = {
+ "/media/music" = {
+ hostPath = "/media/ingens/media/music";
+ isReadOnly = true;
+ };
+ #"/media/podcasts" = {
+ # hostPath = "/media/ingens/media/podcasts";
+ # isReadOnly = true;
+ #};
+ };
+
+ config = { lib, config, pkgs, ... }: {
+ # Network
+ networking.interfaces.eth0.useDHCP = true;
+ networking.firewall.allowedTCPPorts = [ 80 ]; # Caddy
+
+ # Navidrome
+ services.navidrome = {
+ enable = true;
+
+ plugins = with pkgs.navidromePlugins; [
+ #audiomuseai
+ listenbrainz-daily-playlist
+ #lyrics-plugin
+ ];
+
+ settings.MusicFolder = "/media/music/library";
+
+ # The lyrics plugin bundle is named lyrics-plugin.ndp.
+ settings.LyricsPriority = ".ttml,.yaml,.yml,.elrc,.srt,lyrics-plugin,embedded,.lrc,.txt";
+ };
+
+ # Reverse proxy
+ services.caddy = {
+ enable = true;
+ virtualHosts.":80".extraConfig = ''
+ reverse_proxy localhost:4533
+ '';
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge/networking.nix b/hosts/poweredge/networking.nix
new file mode 100644
index 0000000..8be3f4d
--- /dev/null
+++ b/hosts/poweredge/networking.nix
@@ -0,0 +1,167 @@
+let
+ hostIp = "192.168.1.10";
+in { pkgs, config, ... }: {
+ networking = {
+ # Label lan and wan interfaces
+ _interfaceLabels = {
+ enable = true;
+ interfaces.lan0 = "50:9a:4c:5d:c3:7a";
+ interfaces.wan0 = "50:9a:4c:5d:c3:7b";
+ };
+ # Create bridged lan interface for all containers
+ bridges.br-lan0.interfaces = [ "lan0" ];
+ # Disable dhcp on router interfaces
+ interfaces = {
+ veth-router-lan.useDHCP = false;
+ vb-router-lan0.useDHCP = false;
+ };
+ # Configure network
+ defaultGateway = "10.255.255.1"; # Read explaination for veth-router-lan below
+ nameservers = [ "192.168.1.1" ]; # DNS will only be available from this ip address THROUGH the default gateway
+ # br-lan0 will be the interface used for networking on poweredge host
+ interfaces.br-lan0.ipv4.addresses = [{
+ address = hostIp;
+ prefixLength = 24;
+ }];
+ };
+
+ # Secrets
+ sops.secrets.router-wg0 = { sopsFile = ./resources/secrets/router.yaml; key = "wg0"; }; # Office
+ sops.secrets.router-wg1 = { sopsFile = ./resources/secrets/router.yaml; key = "wg1"; }; # Remote access
+
+ # Router container
+ containers.router = {
+ autoStart = true;
+ ephemeral = true;
+ privateNetwork = true;
+ # Pass wan0 directly into container since it isn't needed elsewhere
+ interfaces = [ "wan0" ];
+ # Setup router lan0
+ # NOTE: Host/container communication is not possible through a hostBridge interface
+ extraVeths.vb-router-lan0.hostBridge = "br-lan0";
+ # Setup virtual host-router bridge interface.
+ # This is the default gateway for host/container communication since
+ # communication isn't possible through hostBridge interfaces.
+ # This is essentially equivalent to connecting the host to the
+ # container with a virtual ethernet cable on a separate interface.
+ extraVeths.veth-router-lan = {
+ hostAddress = "10.255.255.2";
+ localAddress = "10.255.255.1";
+ };
+ # Bind secrets to container
+ bindMounts."/run/secrets/wg0" = {
+ hostPath = config.sops.secrets.router-wg0.path;
+ isReadOnly = true;
+ };
+ bindMounts."/run/secrets/wg1" = {
+ hostPath = config.sops.secrets.router-wg1.path;
+ isReadOnly = true;
+ };
+
+ config = { lib, config, ... }: {
+ imports = [
+ ../../nixos/services/router
+ ./router-hosts.nix # Contains dhcp config + static leases + overrides
+ ];
+
+ networking = {
+ # Set ip addresses
+ enableIPv6 = false;
+ interfaces = {
+ vb-router-lan0.ipv4.addresses = [{
+ address = "192.168.1.1";
+ prefixLength = 24;
+ }];
+ wan0.useDHCP = true;
+ };
+ # Setup wireguard
+ wg-quick.interfaces = {
+ wg0.configFile = "/run/secrets/wg0";
+ wg1.configFile = "/run/secrets/wg1";
+ };
+ # NAT (port-forwarding) rules
+ nat.forwardPorts = [
+ { sourcePort = 8333; proto = "tcp"; destination = "192.168.1.44:8333"; } # Bitcoin p2p
+ ];
+ firewall.allowedUDPPorts = [ 51820 ]; # Allow wg1 running on router host through w/o NAT
+ # Additional advanced rules
+ # TODO add multi NAT feature to router service (this is just a normal nat rule)
+ nftables = {
+ enable = true;
+ tables = {
+ # NAT/masquerade wg0 allowing vb-router-lan0 clients to access wg0
+ wg-nat = {
+ family = "ip";
+ content = ''
+ chain post {
+ type nat hook postrouting priority srcnat; policy accept;
+ iifname "vb-router-lan0" oifname "wg0" masquerade comment "vb-router-lan0 => wg0"
+ iifname "veth-router-lan" oifname "wg0" masquerade comment "veth-router-lan => wg0"
+ }
+ '';
+ };
+ # Hairpin for wg1 clients to access the host via veth-router-lan since path is broken otherwise
+ host-hairpin = {
+ family = "ip";
+ content = ''
+ chain pre {
+ type nat hook prerouting priority dstnat; policy accept;
+ iifname "wg1" ip daddr 192.168.1.10 dnat to 10.255.255.2 comment "wg1 => host, redirect via veth"
+ }
+ chain post {
+ type nat hook postrouting priority srcnat; policy accept;
+ ip daddr 10.255.255.2 masquerade comment "wg1 => host, hairpin masquerade"
+ }
+ '';
+ };
+ };
+ };
+ };
+
+ # Setup router
+ services._router = {
+ dnsDhcpConfig.enable = true;
+ routing = {
+ enable = true;
+ interfaces = {
+ lan = [ "vb-router-lan0" "veth-router-lan" ];
+ wan = "wan0";
+ };
+ };
+ };
+
+ services.unbound._blocklists = {
+ enable = true;
+ hageziBlocklists = [ "pro" "nsfw" ];
+ };
+
+
+ environment.systemPackages = with pkgs; [
+ tcpdump
+ ];
+
+ system.stateVersion = "25.11";
+ };
+ };
+
+ # FIXME the following snippet will cause the router container to fail to start:
+ # networking.defaultGateway = {
+ # address = "10.255.255.1";
+ # interface = "veth-router-lan";
+ # };
+ # Journalctl will report:
+ # poweredge container router: Bring veth-router-lan up
+ # poweredge container router: RTNETLINK answers: File exists
+ # poweredge systemd: container@router.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
+ # So the issue nixos is creating an interface with that same name.
+ # As a temporary workaround, the following service is deployed (after the container starts):
+ systemd.services.router-default-route = {
+ after = [ "container@router.service" ];
+ wants = [ "container@router.service" ];
+ serviceConfig.Type = "oneshot";
+ script = ''
+ /run/current-system/sw/bin/ip route replace default via 10.255.255.1 dev veth-router-lan
+ '';
+ wantedBy = [ "multi-user.target" ];
+ };
+}
diff --git a/hosts/poweredge/notification-mailer.nix b/hosts/poweredge/notification-mailer.nix
new file mode 100644
index 0000000..d8fddc7
--- /dev/null
+++ b/hosts/poweredge/notification-mailer.nix
@@ -0,0 +1,27 @@
+{ config, ... }: let
+ serverEmail = "server-notifications@tjkeller.xyz";
+in {
+ # Mailer password secret for mail application password
+ sops.secrets.mailerPassword.sopsFile = ./resources/secrets/mailer-pass.yaml;
+
+ # Enable mta for system event notifications
+ services.mail._mailer = {
+ sender = {
+ host = "mail.tjkeller.xyz";
+ user = serverEmail;
+ from = serverEmail;
+ passwordFile = config.sops.secrets.mailerPassword.path;
+ };
+ recipient = serverEmail;
+ };
+
+ # Enable zed mailer module
+ services.zfs._zedMailer.enable = true;
+
+ # Enable smartd notifications
+ services.smartd.notifications.mail = {
+ enable = true;
+ sender = serverEmail;
+ recipient = serverEmail;
+ };
+}
diff --git a/hosts/poweredge/nvidia.nix b/hosts/poweredge/nvidia.nix
new file mode 100644
index 0000000..5eecc71
--- /dev/null
+++ b/hosts/poweredge/nvidia.nix
@@ -0,0 +1,29 @@
+{ lib, config, pkgs, ... }: {
+ # Configure nixpkgs for nvidia/cuda
+ nixpkgs.config = {
+ cudaSupport = true;
+ allowUnfreePredicate = pkg:
+ pkgs._cuda.lib.allowUnfreeCudaPredicate pkg
+ || builtins.elem (lib.getName pkg) [
+ "nvidia-x11"
+ "nvidia-kernel-modules"
+ ];
+ };
+
+ # NVIDIA
+ services.xserver.videoDrivers = [ "nvidia" ]; # xserver.videoDrivers does not imply X
+ hardware.graphics.enable = true;
+ hardware.nvidia = {
+ modesetting.enable = true; # Required
+ nvidiaSettings = false; # Don't need gui
+ open = false;
+ package = config.boot.kernelPackages.nvidiaPackages.legacy_580; # Support for P600
+ powerManagement.enable = false; # Can cause bugs
+ powerManagement.finegrained = false; # Only works on turing and newer
+ };
+
+ # Packages
+ environment.systemPackages = with pkgs; [
+ config.hardware.nvidia.package # nvidia-smi
+ ];
+}
diff --git a/hosts/poweredge/resources/secrets/ddns-updater-config.yaml b/hosts/poweredge/resources/secrets/ddns-updater-config.yaml
new file mode 100644
index 0000000..3be017b
--- /dev/null
+++ b/hosts/poweredge/resources/secrets/ddns-updater-config.yaml
@@ -0,0 +1,16 @@
+ddns-updater-config: ENC[AES256_GCM,data:vJ3z4R6P1gHKfkm6L2mQl68MKDJwpMNmrAOQo+4GkO2NC6EjKTLoSKhFiaGWVjMm7nrVfYRV+U/6b4VJXV4qURWhsm41t3x8zXAtt0viLC6pv+uMtuxadhU2Zxij4U2bSiMn6sSbfHd3uGIym7FnfOIL3LPEanVMuRUk20a0ZgHBdq1BPk6r5V8AoGfsu1XWHTvnO4ggg9oQPtGhurKTXixTD0Rb1Iv43JXLXqK/O3JGD5h4XbDmXB9eTqiBHUgZ0E4F5SE23L5mO0kI0TNNph2lTHXdfB+5,iv:xFry3gzdvvYh127yhYySvp5UHDa8Y+t/bg2+mwJ/HXo=,tag:pH2CE2l2UpNJiLJ+tjVvqQ==,type:str]
+sops:
+ age:
+ - recipient: age1zfvmt2avdlfz0fvchczplc84u7m8vqausm7zytl9s4x9m9yax4cqy30zpz
+ enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBtWitQcVlaTmFVaHIraHlT
+ VFBDVEtlQUlqckN4eFF3YU95N3ZNU3JQcFNzCnkrR2xmTEtyUHRWQlRnTWZSaGVT
+ U0wvcGt6R0w4L3dSakVDVWVpTUhWbWMKLS0tIGVKSXVTL1B2L2FlSkQwSDVYd3Fk
+ WE8rLy81UEU5ZG9SaHRLOHNqOWUzWnMKBFtzJ9frroYk6hoW+1ww/3LpxCEa1Vtr
+ KNNnHKry8lQQDmalN5ZVYMTVAlTnQQ6QE7DxBukUwWYmizQ+BY8HDg==
+ -----END AGE ENCRYPTED FILE-----
+ lastmodified: "2026-03-31T01:47:37Z"
+ mac: ENC[AES256_GCM,data:8ozC5JWR/s3nNK+njc7zO32/7ptd//wuWGWZPHXrPV1iVyYndczGgu0ekEyKeRCn/WwGE5pyt32gy0l2Y+k7j7mV6GJguy6qhltani6Mz2Gfy5sRohn5s2rBDTiSYEVAgGTRt56DLxGD36P6xFPm+wHGspjCzNALrPretuN5xFg=,iv:+/mlXEMEO80pDVpFwZmnyywvHR/V9zHkbloF/e/dJ6Q=,tag:O+Ox0xUzERjeB+VftiUNEg==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.12.1
diff --git a/hosts/poweredge/resources/secrets/grafana.yaml b/hosts/poweredge/resources/secrets/grafana.yaml
new file mode 100644
index 0000000..91b9188
--- /dev/null
+++ b/hosts/poweredge/resources/secrets/grafana.yaml
@@ -0,0 +1,16 @@
+secret_key: ENC[AES256_GCM,data:9GHuENHGk+VKukRuUJi+fxOX+ZFa5q5t5UiGtxSQOEctu9LOJqvHJerFv3U=,iv:6OJTeWbotDVj/ogg9WC170Q4Kdfd1PXf0hHwXd/YaUQ=,tag:qlnEl2uzDuhwOKp17R76Tg==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBrc0tWWHhtM2Q5UC9weSsr
+ WDdaOXJjZGVoekJKaXUyUXhsRXMxMjQrYUFnCnBqTGJEMFF6clQ1RXd5NE9CenQ5
+ U0swNHdNUUxndnlycGVGM0lpY0dFaVEKLS0tIHVlK2MySUJzaGVXd21iWFFzcEJM
+ Nmh3V2hIbUhWNUxlOE1idTdWNWZ6alEKWae75mhvfpTNOcvm7x1zf19QkmZqrAf7
+ jpkyKDE//d4Rn3h4Ogpl5bdXb9RyOoSEJUG+EDPFyynqdodCJ2ucpw==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1zfvmt2avdlfz0fvchczplc84u7m8vqausm7zytl9s4x9m9yax4cqy30zpz
+ lastmodified: "2026-06-18T22:40:22Z"
+ mac: ENC[AES256_GCM,data:5HoPrQU8Q+SGEH4jQHy1otFXGILqttDpcbv+edNoKI/QFoUE74M4PrGzltlManZstqK3nfWV3HNIcY6GRe8TMP5ANC/8UIXfEDerP1Q0kj6xeyLumMCJ6iCjygF2SzL5YMWqBSsCJvH5O10sWncc2iPnGrQPJ8PksIxkXCe4YYk=,iv:f0WpJwENciWkyDKpGM/PaE2lmXWvNiMAxNpqlCEFhM8=,tag:nQAPTJPYsgRIUkDxktIvmA==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.13.1
diff --git a/hosts/poweredge/resources/secrets/mailer-pass.yaml b/hosts/poweredge/resources/secrets/mailer-pass.yaml
new file mode 100644
index 0000000..331bd66
--- /dev/null
+++ b/hosts/poweredge/resources/secrets/mailer-pass.yaml
@@ -0,0 +1,16 @@
+pass: ENC[AES256_GCM,data:RHOvLwbDIb8FZ+dG66e5U43qR0aXlLLZGAnlbRjSl8hxCMEtJ4940nggiaIV75jCaiWyLutay7MrKPKZBHDZwBIqcJYQRWm1zWGkoZi0/bX38vUFWOpI4qku9fIB2qll,iv:bqEnTagxlRqlAmMgFCtXXCSSlODE598yoV4fU0jSYL8=,tag:c/ZiGCDSb8quDoYiIKbMeQ==,type:str]
+sops:
+ age:
+ - recipient: age1zfvmt2avdlfz0fvchczplc84u7m8vqausm7zytl9s4x9m9yax4cqy30zpz
+ enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBEUXlZaUhSUkNGK2xpVzRp
+ OEhYMTV6bnpPZC9tdHZWbnZxcUp6WWVLMnhFCmZmckVBckdRS1g0MjJQdE80S2Js
+ aGlNek1nSmU2aGI4cWVXR0NmbjJwa00KLS0tIDJ3N3BoenQ5ZW02K3BLNWxkWU5y
+ Ym56YzI5Zk9KeFhzZXJXR3NoOUl0ckEKOLweZrk/Pe6BG48+RrwOxyOy0Zb768aZ
+ YIxTBv/qSzZei6VqZHiIwTUEMyE7z3CS0dBFws6q4fB4LfIpv6fiYg==
+ -----END AGE ENCRYPTED FILE-----
+ lastmodified: "2026-03-31T01:37:29Z"
+ mac: ENC[AES256_GCM,data:WIGXvuwB4bcBDfMRrrMQ7faUkxFdreyYiuy6bNPI2pzvvUFTSo/lJTv/DjisSARdYmFHFvdResIXUjg75Sc2I5IrvRxZxnYqx/3z5k/WOFWb8HSKH2H+OUHtLkqWJSCQ9YBuX2tys93mEXgwchPpn4nzVaYBgxZl54F3icX7tsE=,iv:BS9KPGkVaH0G0bAZz6+LR0NDcmqw6khOkih5DyvGyug=,tag:dA9YVL1xEqUqe6hDzOH7XQ==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.12.1
diff --git a/hosts/poweredge/resources/secrets/router.yaml b/hosts/poweredge/resources/secrets/router.yaml
new file mode 100644
index 0000000..4cd3398
--- /dev/null
+++ b/hosts/poweredge/resources/secrets/router.yaml
@@ -0,0 +1,17 @@
+wg0: ENC[AES256_GCM,data:hxZrOTMx2lS7dkQPV48jUbHxoNr32KSM/wG0OPY8mcgHX4FsHStdH/CN4qlkH9co90yFKjwqcJ3fHXaSbIhp3oIYTo1R2/8KggHV+az4skb7v4kzZgU5u5V2B57gIRFrPHBBq1UtDkBBpANr7zypeLPuEzvCQaZiexrsCcET7xwhsEYtVc5WlISMHhi6sFzo1AeEVfwFvIUN9geXJwP3JycYRpaNXOVYAbPwer8fYa6mnFZIk+sruCO85QNoWQ2T1wPiC9U7Ki9q+FOaOzJWGdpiG3nQdeYlDgAwoPRNi3c0J6t3CS9xC+qC0y4esOL7ay4S2dDoL9ftChQjhWaGdq5+LeyXAPlATGs5aFtBMwEecQ5OPXTri2D5m/gVLW/TGmUT5ZVPymm/wAX+m4IWK6X3FylWnlEoUh+4cBO+2zjTbXEccRuJTOEZAGIsEg==,iv:ycsGniDPFOvFFGqCgiyCWkCS8AxFV7JbXgUxDPXAFmk=,tag:uXkB8b7S3sW9noTIK4J/Zw==,type:str]
+wg1: ENC[AES256_GCM,data:RIoKsBtvJ90mw3+Vs3K9MoVoLiGlO9ef1kom8Hkww5SFc9JcVAvs9JUgYrOoc5ATWTK6LPipXaQibWrbHTeBadZnAcRiHeL3/8FOgr8TkzH0KfDL7fd/AKzvJMf/fRZv6DCrY3LRn0PSwkPePiY7aoSpQRxScoR7mU8EOougUUPFolANZAjssKhFUix9bRO6/reU+B3Mzq30ozmMC+J4tsfYHe2beVS0qkLqTEyzh4hsSF3HCAHSUm0NunQwQlo0y2eYR+4tCXNje5X8PqxTRZpqLEFYaUDigdsmXX8DaVulszPnwGaAPsTMcZEGtO3FtPapVDfial3BrSgXZxTaE+a9t5m/F50aNUS1yxQHKd7lNrfI4Q1pX6ktAyW378mFhdT3fygHogkbjMrm947OdenZlA7jKRrsxQ2hVqP6g6x5/910nH7DVLEBkJ85TQfx5bd0eMQvcc/ox6NuCZZFaXCyry5MHZZa0o0Pnw3BW61J56Pxr2t8sraZFhfsTxTOyiL/L5O+PCd0osCn9SBTl8TAJl+/o8wje/GuFGtFkv54pJ9M1e86LKYt/ksU3HDwTDlblmwhtHILdy+ld2XU52ympCu5b9Ix61OTj4sqFYAfob+Ft5lPcbWqbT43HySW9iDTRbtcZVEXuZItrAlnQiXKe3CjQzPizY9P4KoFliUad8qOyvQ6PFG2ExaUL2vwXkQbk0gaCwfhg5HGg/AR2/y4mcey0gVyXJRm4WTSllNom48gEq/ylZcU9hWASNfkHj5W/MXeKbXMsu1u/6tv51anXEdNQTARIu+8zGSDHwL3wRw9hsiz7Fcg98rOrRZPRSjYniLxm2pkXvIZuS5lUUv6bRnEPv/3mw+HBjomjOVhNxdGa21AEf1QtItlBtWTnZawjY3KJumx4GuZmQQ5cunnlUp2Qu2k2jsNDQqhLEK0/gbgLkhi0Eh8lp9xJdQ0iXCqaALs4CcKM/3n/2THmN1Mjq+hjKNwY/TOZdfnyA9NPwQNB3UO5vd8za2/XfeObNRBs+Vd3hV9o1fyynYtHuhYwe0W6AKwmeotS87Jbl5jDu/r5ckpMNM6E+x89Bz95Y6VTh8zWA==,iv:X53OauqcsQEJou7gt/MuqUQ50VwA6hp5ykQ096HJb4c=,tag:k5v+KQtWj6dxjmp/zjvPKw==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxOFFVRFl2MDhiUVRPdnZJ
+ b3BSZ0pSaG8vR3o3SGlmVENvN3ZObHU3eUc4CmJrdk8rbXpBMWhTZ2hvdlk0VWo1
+ ejdnTDR4bFlUUXc4Smd0NEp6b3crZFUKLS0tIFBsQUdRWjZLSDY1ZlFaRDdLOVhs
+ MFFGY0NSU3NaK2U0U1NndUIyYm54ZWsKZ6q9j1fNaNSzBA0rbZYyUWt3U2V/7/9/
+ FZTKd8mH/uCoxvK8unlVZ9uYNADRh2smp7LwK1AWie/6khAIFqVBeg==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1zfvmt2avdlfz0fvchczplc84u7m8vqausm7zytl9s4x9m9yax4cqy30zpz
+ lastmodified: "2026-10-09T21:56:37Z"
+ mac: ENC[AES256_GCM,data:yLU812vLFtABilSRFy44EI5YrNYypfoCM11QKZglw+RZcCjLZlm2zd53t3RsH2y0w2cEWsGsyECNWM2iES3F4+HqrBZmlVZ27GBSoGmX8+FzJnPkvlcfIG3F6C03AU7BLApjYmR+Lu0m2WdhwwXcCSvwN0HAKRZF0pHogoS/+6A=,iv:tMdCvkRBd6xbTPMuazNsT8tBSS4A2YOeaG0rRAxMwsI=,tag:KewEK3C9xhEh6YbDPi3GoQ==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.13.3
diff --git a/hosts/poweredge/resources/secrets/slskd.yaml b/hosts/poweredge/resources/secrets/slskd.yaml
new file mode 100644
index 0000000..3f0a43b
--- /dev/null
+++ b/hosts/poweredge/resources/secrets/slskd.yaml
@@ -0,0 +1,16 @@
+env-file: ENC[AES256_GCM,data:HFyQoP9iZMx4ieCk7f36McCTVN+5P+wZ5O+4bztmvIjJkdT4CgzXQDEuDEfDCwPNW25hAR+zV6znW6eO/tDoJndliD0ifl6+xODL9g34nInfocB1+alMjcHFz3Ix9HEMUYkABZ3qxn9DQGagrlRBB0sDMHkW2fRcl2Sd7qY5lhM676jpfF+oh2QTWYn9ZP8aS9FcYB2SaeFox3o=,iv:18IODA/fQBwlJhvNKXuo0kc18w4dEspEz5inusnh1f4=,tag:2jAJr5R5LnKwRAhC5lb5Pg==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA2WitIOGhGVUp3N0pTQkds
+ OUJOQ0hReExNNEhZaXhENURwMGFGN3pBckVjClcvbDY4VUpXeWJXa0lLdWVoazNT
+ S2JjKzFaZ3lwWkZNbnRpOEpmREtMTm8KLS0tIE9yTXQvVzRvVU1YSGRLbWtQaGRB
+ REx6K2loY3JsTmFkNzZzN3FDdzhaaWsKRVP71gq5x0qPmWwhsDgTtDwe5Ip6cg78
+ pvU/OeUmXEdLJAsXFAaCIKPe5QSMaopgKiB9rfXJFM3mn2bhnHNYBQ==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1zfvmt2avdlfz0fvchczplc84u7m8vqausm7zytl9s4x9m9yax4cqy30zpz
+ lastmodified: "2026-10-28T22:22:21Z"
+ mac: ENC[AES256_GCM,data:lhyXZ2PEZ59C7EfshQ5x09dmLTeAhlEjt5rwpMjdVcicUKioH1GdUD+hjKNAUDCfuBS1Oy/ay0yFGn9TZvMqngbXRgSxx4EY26EssvmfZ6wgp1F8t41+gm0tuQFUkkn51k713O21sTAZS7BfpOyiFCHYD852RbRoENJrgRK6KQk=,iv:Jw2Tw1QwdxY7cTT0UBiVJmJhtp+nNsQttv7G8yHs8Rk=,tag:CwjZpbMi8T4ubNMen0EqYg==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.13.3
diff --git a/hosts/poweredge/resources/secrets/vpn-router.yaml b/hosts/poweredge/resources/secrets/vpn-router.yaml
new file mode 100644
index 0000000..12c109b
--- /dev/null
+++ b/hosts/poweredge/resources/secrets/vpn-router.yaml
@@ -0,0 +1,17 @@
+ovpn-auth: ENC[AES256_GCM,data:9B/JKqliPVmzAiTX9gCayS2lLGqshFONueMz,iv:Yx+6VIP8W0/N059kqL2kAgdYrS8PT/Zk6WU6Tlfm+Kg=,tag:tUQG1Ry8FHQoCPYFcx7PFA==,type:str]
+ovpn-config: ENC[AES256_GCM,data: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,iv:R+LK9n9f87YU5bJMXVyNueE7CuLosFcdXzWReASCV5g=,tag:EXYg43lPkDugSUWJG4KgLw==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSByNVd5TUlvczNnd2pzZnJn
+ eUREOFYrSmVYcGNDQzJqQlJETlk1R3Z1Mkc4Ckl5SFc1Tmdta2RQdkw2eXVTR3FX
+ TjFNTTlVTTgweHg1b1dNWjVXM2wzVU0KLS0tIDk2SkpDUWlwemVXY3Rveld1dXFV
+ ZWVTMjVKWVJaU0cvbjdOZTNaVWdlY28KsmuwUmhYdvcJLHIdBVJ6RKnPGlZmhG8q
+ dzotK3ZTynQPJYGC6n6OD1I3fV6GAYXNaVKafR6ckuJ5n0wbS+jjCg==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1zfvmt2avdlfz0fvchczplc84u7m8vqausm7zytl9s4x9m9yax4cqy30zpz
+ lastmodified: "2026-10-28T22:18:45Z"
+ mac: ENC[AES256_GCM,data:fHLraNMezdvfGcTKf1kFpvWbDb1NM9FgRBYtG81IFl4HGhqvRwekRLty0UeT02IKk4LAdzs0QwSSDVUlo3Sun/1xqXgYWK0DDkPlNfQQ6IO45YJn9ESAmTFqWTKFdPjUNcl8EeUJdelHoYd/9p4dw4FL/2OTO4zb/XM7IsfZ+FU=,iv:Uq4Mpvk0OtkOnb7bk+sEUDxFeWLA5CZL0MJjrxNZ3gw=,tag:Q5zMdI1C5LQQ8HZRdjAHgA==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.13.3
diff --git a/hosts/poweredge/router-hosts.nix b/hosts/poweredge/router-hosts.nix
new file mode 100644
index 0000000..4e14c01
--- /dev/null
+++ b/hosts/poweredge/router-hosts.nix
@@ -0,0 +1,48 @@
+let
+ localDomain = "home.lan"; # TODO RFC8375 .home.arpa
+ dhcp = {
+ inherit staticLeases;
+ defaultGateway = "192.168.1.1";
+ localhostIp = "192.168.1.1";
+ rangeStart = "192.168.1.65";
+ rangeEnd = "192.168.1.250";
+ };
+ staticLeases = {
+ # Network
+ idrac-7N94GK2 = { macAddress = "50:9a:4c:5d:c3:7c"; staticIp = "192.168.1.2"; };
+ OpenWrt-Attic = { macAddress = "34:98:b5:60:5e:be"; staticIp = "192.168.1.3"; };
+ OpenWrt-Basement = { macAddress = "8c:3b:ad:35:c7:8c"; staticIp = "192.168.1.4"; };
+ ArcherC54 = { macAddress = "14:eb:b6:13:f9:e0"; staticIp = "192.168.1.5"; };
+ vpn-router = { macAddress = "02:00:00:00:01:09"; staticIp = "192.168.1.9"; };
+ # Desktops
+ optiplex = { macAddress = "e4:54:e8:bc:ba:05"; staticIp = "192.168.1.12"; };
+ X230 = { macAddress = "84:3a:4b:60:34:c4"; staticIp = "192.168.1.13"; };
+ # Appliances
+ # TODO add epson printer
+ p1s = { macAddress = "3c:0f:02:d5:23:64"; staticIp = "192.168.1.39"; };
+ gnuslashprinter = { macAddress = "00:23:24:5b:f0:6d"; staticIp = "192.168.1.40"; };
+ # Services
+ immich = { macAddress = "02:00:00:00:00:01"; staticIp = "192.168.1.41"; };
+ jellyfin = { macAddress = "02:00:00:00:00:02"; staticIp = "192.168.1.42"; };
+ gitea = { macAddress = "02:00:00:00:00:03"; staticIp = "192.168.1.43"; };
+ bitcoind = { macAddress = "02:00:00:00:00:04"; staticIp = "192.168.1.44"; };
+ filebrowser = { macAddress = "02:00:00:00:00:05"; staticIp = "192.168.1.45"; };
+ grafana = { macAddress = "02:00:00:00:00:06"; staticIp = "192.168.1.46"; };
+ transmission = { macAddress = "02:00:00:00:01:47"; staticIp = "192.168.1.47"; };
+ navidrome = { macAddress = "02:00:00:00:00:08"; staticIp = "192.168.1.48"; };
+ slskd = { macAddress = "02:00:00:00:01:51"; staticIp = "192.168.1.51"; };
+ };
+ localDomainOverrides = {
+ "router.${localDomain}" = "192.168.1.1"; # FIXME ping router on separate host returns 127.0.0.2
+ "poweredge.${localDomain}" = "192.168.1.10";
+ };
+in {
+ imports = [ ../poweredge-pro/dns-overrides.nix ]; # Import dns overrides from poweredge pro for use with tun
+ services._router.dnsDhcpConfig = {
+ inherit dhcp;
+ localResolution = {
+ inherit localDomain localDomainOverrides;
+ };
+ };
+ networking.hosts."192.168.1.1" = [ "router.${localDomain}" "router" ];
+}
diff --git a/hosts/poweredge/slskd.nix b/hosts/poweredge/slskd.nix
new file mode 100644
index 0000000..542757f
--- /dev/null
+++ b/hosts/poweredge/slskd.nix
@@ -0,0 +1,91 @@
+{ config, ... }: {
+ # Secrets
+ sops.secrets.slskd-env = { sopsFile = ./resources/secrets/slskd.yaml; key = "env-file"; };
+
+ # Container
+ containers.slskd = let
+ home = "/var/lib/slskd";
+ download-dir = "${home}/complete";
+ incomplete-dir = "${home}/incomplete";
+ in {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:01:51";
+
+ # Download dirs, shared with transmission's media tree, plus a
+ # read-only mount of the whole library for Soulseek sharing
+ bindMounts = {
+ "${download-dir}" = {
+ hostPath = "/media/ingens/media/dls/slskd/complete";
+ isReadOnly = false;
+ };
+ "${incomplete-dir}" = {
+ hostPath = "/media/ingens/media/dls/slskd/incomplete";
+ isReadOnly = false;
+ };
+ "/srv" = {
+ hostPath = "/media/ingens/media/dls/slskd/srv";
+ isReadOnly = false;
+ };
+ "/media/ingens/media" = {
+ hostPath = "/media/ingens/media";
+ isReadOnly = true;
+ };
+ };
+
+ # Bind secrets
+ bindMounts."/run/secrets/slskd.env" = {
+ hostPath = config.sops.secrets.slskd-env.path;
+ isReadOnly = true;
+ };
+
+ config = { lib, config, pkgs, ... }: {
+ # Network
+ networking = {
+ enableIPv6 = false; # Prevent ip leaks
+ firewall.allowedTCPPorts = [ 80 50300 ]; # Web ui + soulseek listen port tcp
+ firewall.allowedUDPPorts = [ 50300 ]; # soulseek listen port udp
+ # DHCP (see transmission.nix)
+ interfaces.eth0.useDHCP = true;
+ dhcpcd.extraConfig = ''
+ interface eth0
+ static routers=192.168.1.9
+ static domain_name_servers=9.9.9.9 1.1.1.1
+ '';
+ };
+
+ # slskd
+ services.slskd = {
+ enable = true;
+ environmentFile = "/run/secrets/slskd.env";
+ settings = {
+ directories = {
+ downloads = download-dir;
+ incomplete = incomplete-dir;
+ };
+ shares.directories = [ "/srv" ];
+ transfers = {
+ upload.slots = 5;
+ upload.speed_limit = 0;
+ download.slots = 5;
+ download.speed_limit = 0;
+ };
+ flags.no_version_check = true;
+ };
+ };
+
+ users.users.slskd.uid = 1000; # uid is not set otherwise
+
+ # Reverse proxy
+ services.caddy = {
+ enable = true;
+ virtualHosts.":80".extraConfig = ''
+ reverse_proxy localhost:5030
+ '';
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge/transmission.nix b/hosts/poweredge/transmission.nix
new file mode 100644
index 0000000..047a3ab
--- /dev/null
+++ b/hosts/poweredge/transmission.nix
@@ -0,0 +1,75 @@
+{
+ # Container
+ containers.transmission = let
+ home = "/var/lib/transmission";
+ download-dir = "${home}/Downloads";
+ incomplete-dir = "${home}/.incomplete";
+ in {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:01:47";
+
+ # Download dirs
+ bindMounts = {
+ "${download-dir}" = {
+ hostPath = "/media/ingens/media/dls/transmission/complete";
+ isReadOnly = false;
+ };
+ "${incomplete-dir}" = {
+ hostPath = "/media/ingens/media/dls/transmission/incomplete";
+ isReadOnly = false;
+ };
+ "/media/ingens/media" = {
+ hostPath = "/media/ingens/media";
+ isReadOnly = false;
+ };
+ };
+
+ config = { lib, ... }: {
+ # Network
+ networking = {
+ enableIPv6 = false; # Prevent ip leaks
+ firewall.allowedTCPPorts = [ 80 51413 ]; # RPC interface + transmission tcp
+ firewall.allowedUDPPorts = [ 51413 ]; # transmission udp
+ # Override dhcp server settings for default route and dns servers with static settings
+ interfaces.eth0.useDHCP = true;
+ dhcpcd.extraConfig = ''
+ interface eth0
+ static routers=192.168.1.9
+ static domain_name_servers=9.9.9.9 1.1.1.1
+ '';
+ #defaultGateway = "192.168.1.9"; # Doesn't work, see above
+ #nameservers = [ "9.9.9.9" "1.1.1.1" ]; # Does work, above prevents using dhcp default nameserver
+ };
+
+ # Transmission
+ services.transmission = {
+ inherit home;
+ enable = true;
+ user = "transmission";
+
+ settings = {
+ inherit download-dir incomplete-dir;
+ downloadDirPermissions = "775";
+ };
+ };
+
+ # TODO remove (#258793)
+ systemd.services.transmission.serviceConfig = {
+ RootDirectoryStartOnly = lib.mkForce null;
+ RootDirectory = lib.mkForce null;
+ };
+
+ # Reverse proxy
+ services.caddy = {
+ enable = true;
+ virtualHosts.":80".extraConfig = ''
+ reverse_proxy localhost:9091
+ '';
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/poweredge/vpn-router.nix b/hosts/poweredge/vpn-router.nix
new file mode 100644
index 0000000..ac7ce16
--- /dev/null
+++ b/hosts/poweredge/vpn-router.nix
@@ -0,0 +1,121 @@
+{ lib, config, pkgs, ... }: {
+ # Secrets
+ sops.secrets.vpn-router-ovpn-config = { sopsFile = ./resources/secrets/vpn-router.yaml; key = "ovpn-config"; };
+ sops.secrets.vpn-router-ovpn-auth = { sopsFile = ./resources/secrets/vpn-router.yaml; key = "ovpn-auth"; };
+
+ # Container
+ containers.vpn-router = {
+ autoStart = true;
+ privateNetwork = true;
+ enableTun = true; # OpenVPN requires
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:01:09";
+
+ # Bind secrets
+ bindMounts = {
+ "/run/secrets/ovpn-config.ovpn" = {
+ hostPath = config.sops.secrets.vpn-router-ovpn-config.path;
+ isReadOnly = true;
+ };
+ "/run/secrets/ovpn-auth" = {
+ hostPath = config.sops.secrets.vpn-router-ovpn-auth.path;
+ isReadOnly = true;
+ };
+ };
+
+ config = { lib, pkgs, ... }: {
+
+ # Networking
+ networking = {
+ enableIPv6 = false; # Prevent ip leaks
+ interfaces.eth0.useDHCP = true;
+ };
+
+ # Router config
+ # This container acts as a router that clients can connect to via default
+ # route. All traffic is forwarded over the VPN tunnel instead of WAN.
+ # This allows multiple containers to share the same VPN connection.
+ boot.kernel.sysctl."net.ipv4.ip_forward" = 1; # Enable IPv4 forwarding
+ networking.nat = {
+ enable = true;
+ externalInterface = "tun0";
+ internalInterfaces = [ "eth0" ];
+ # Forward ports over VPN
+ forwardPorts = [
+ { sourcePort = 51413; proto = "tcp"; destination = "192.168.1.47:51413"; } # Transmission TCP
+ { sourcePort = 51413; proto = "udp"; destination = "192.168.1.47:51413"; } # Transmission UDP
+ { sourcePort = 50300; proto = "tcp"; destination = "192.168.1.51:50300"; } # Slskd TCP
+ { sourcePort = 50300; proto = "udp"; destination = "192.168.1.51:50300"; } # Slskd UDP
+ ];
+ };
+
+ # OpenVPN
+ services.openvpn.servers.main = {
+ config = ''
+ config /run/secrets/ovpn-config.ovpn
+ auth-user-pass /run/secrets/ovpn-auth
+
+ # The server pushes tun-mtu 1500. A full 1500 byte packet plus
+ # AES-256-GCM/UDP/IP encapsulation (~52 bytes) is ~1552 on the wire,
+ # so it has to be IP fragmented to cross a 1500 byte path -- and the
+ # fragments get dropped upstream, blackholing every full size packet
+ # while small ones (dns, tcp handshakes) still pass. Clamp the TCP MSS
+ # so the encapsulated datagram never exceeds this, in both directions.
+ # Must come after the `config` include above so it wins.
+ #mssfix 1400
+ '';
+ autoStart = true;
+ updateResolvConf = true;
+ };
+
+ # VPN "killswitch", split across two chains:
+ networking.firewall.extraCommands = ''
+ # Get domain name host and port from ovpn config
+ SERVER_HOST=$(${pkgs.gawk}/bin/awk '/^remote /{print $2;exit}' /run/secrets/ovpn-config.ovpn)
+ SERVER_PORT=$(${pkgs.gawk}/bin/awk '/^remote /{print $3;exit}' /run/secrets/ovpn-config.ovpn)
+ [ -n "$SERVER_PORT" ] || SERVER_PORT=1194
+
+ # Router's own traffic: only lo, tun0, and established connections
+ ${pkgs.iptables}/bin/iptables -P OUTPUT DROP
+ ${pkgs.iptables}/bin/iptables -A OUTPUT -o lo -j ACCEPT
+ ${pkgs.iptables}/bin/iptables -A OUTPUT -o tun0 -j ACCEPT
+ ${pkgs.iptables}/bin/iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
+
+ # Get dns ip from resolv.conf
+ DNS_IP=$(${pkgs.gawk}/bin/awk '/^nameserver /{ if ($2 !~ /:/) { print $2; exit } }' /etc/resolv.conf)
+
+ # Allow dns
+ ${pkgs.iptables}/bin/iptables -A OUTPUT -o eth0 -p udp -d "$DNS_IP" --dport 53 -j ACCEPT
+ ${pkgs.iptables}/bin/iptables -A OUTPUT -o eth0 -p tcp -d "$DNS_IP" --dport 53 -j ACCEPT
+
+ # Resolve server ips from host
+ SERVER_IPS=""
+ ATTEMPT=0
+ while [ -z "$SERVER_IPS" ] && [ "$ATTEMPT" -lt 10 ]; do
+ ATTEMPT=$((ATTEMPT + 1))
+ SERVER_IPS=$(${pkgs.getent}/bin/getent ahostsv4 "$SERVER_HOST" 2>/dev/null | ${pkgs.gawk}/bin/awk '/STREAM/{print $1}')
+ [ -n "$SERVER_IPS" ] || sleep 3
+ done
+
+ # Die if no ips are resolved
+ if [ -z "$SERVER_IPS" ]; then
+ echo "killswitch: could not resolve '$SERVER_HOST' after $ATTEMPT attempts, failing closed with no vpn egress"
+ exit 1
+ fi
+
+ # Allow udp traffic to each vpn server ip (for openvpn udp tunnels only, strictly better than tcp)
+ for SERVER_IP in $SERVER_IPS; do
+ echo "killswitch: allowing $SERVER_IP:$SERVER_PORT/udp ($SERVER_HOST)"
+ ${pkgs.iptables}/bin/iptables -A OUTPUT -p udp -d "$SERVER_IP" --dport "$SERVER_PORT" -j ACCEPT
+ done
+
+ # Anything forwarded through this router: only allowed to reach tun0
+ ${pkgs.iptables}/bin/iptables -P FORWARD DROP
+ ${pkgs.iptables}/bin/iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
+ ${pkgs.iptables}/bin/iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT
+ '';
+
+ system.stateVersion = "26.05";
+ };
+ };
+}
diff --git a/hosts/sweetiepc/configuration.nix b/hosts/sweetiepc/configuration.nix
new file mode 100644
index 0000000..7bf5fcb
--- /dev/null
+++ b/hosts/sweetiepc/configuration.nix
@@ -0,0 +1,51 @@
+{ config, lib, pkgs, home-manager, ... }: {
+ #imports = [ ./wg.nix ];
+
+ # Setup bootloader
+ boot._loader = {
+ enable = true;
+ loader = "grub";
+ };
+
+ # Enable common options
+ _archetypes = {
+ profiles = {
+ desktop = {
+ enable = true;
+ home.users.timmy.enable = true;
+ };
+ zfs.enable = true;
+ btrfs.enable = true;
+ gnome.enable = true;
+ };
+ collections = {
+ desktop = {
+ office.enable = true;
+ };
+ };
+ };
+
+ # Import zfs pools
+ boot.zfs.extraPools = [ "geminus" "quattuor" ];
+
+ # Enable user timmy
+ _users.timmy = {
+ enable = true;
+ };
+
+ # Disable suspend
+ systemd._suspend.disable = true;
+
+ # Configure home
+ home-manager.users.timmy = {
+ fonts.fontconfig = {
+ subpixelRendering = "rgb";
+ hinting = "none";
+ };
+ };
+
+ # Without this, "ZFS requires networking.hostId to be set" will be raised
+ networking.hostId = "fdde503a";
+
+ system.stateVersion = "26.05";
+}
diff --git a/hosts/sweetiepc/hardware-configuration.nix b/hosts/sweetiepc/hardware-configuration.nix
new file mode 100644
index 0000000..5ed162c
--- /dev/null
+++ b/hosts/sweetiepc/hardware-configuration.nix
@@ -0,0 +1,38 @@
+# 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 = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/91572803-436d-4f43-b41f-dfba2103752e";
+ fsType = "btrfs";
+ options = [ "subvol=@" ];
+ };
+
+ fileSystems."/home" =
+ { device = "/dev/disk/by-uuid/91572803-436d-4f43-b41f-dfba2103752e";
+ fsType = "btrfs";
+ options = [ "subvol=@home" ];
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/F618-D6C2";
+ fsType = "vfat";
+ options = [ "fmask=0022" "dmask=0022" ];
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/hosts/sweetiepc/resources/secrets/wg.yaml b/hosts/sweetiepc/resources/secrets/wg.yaml
new file mode 100644
index 0000000..9edaea5
--- /dev/null
+++ b/hosts/sweetiepc/resources/secrets/wg.yaml
@@ -0,0 +1,16 @@
+wg0: ENC[AES256_GCM,data:xow2iL5l7MqlUeCZ2e9R4ygKlK3+ZP2yIR73aHWiIaO24aF02I88cWajOvs44/CP2tTHJLM6OltN/rKr3+4DLCbhOrngl/uFyWv/Xva4n9ZCWBv0DgtQ0Qbk/Bi6Q+h3Uf7XXlOtsUNvzSXvW4L+EcwsTMQRU5CIpSHcIsyG/IsQ1ypHpzDPM8j3HHtoPp6zaYPpQiELoMIIuIjvnvjTAAEWYMPuiV4OgJy2kiAUFkEwDud3MV/e/D/q861lKSz5qiKWnxE/So9kmA4HaSw9EOi46EcFojat7r3LiludcMify4V+IliVs7LPYf8kaHSOPWdmd8cgDeYP3Np0ydhB2+2xSbRLCgZvJWuxkStbeNjA5sC3tAmA86I+axhjVGRD9NdbpksdDORBMJhx2iWVhBBvM5p/Ya0f5nXHlsLw4MLSCKOZlTf9OM5YlYGw/GA30nJbcOVx1TzK+BJ0cYsz7U4YJWEMHTEPIQ==,iv:TM0Csdn65smwseVzq36IJAcapEZx+yjhRyG3Atz2Jk0=,tag:A6wWrO8PJAPFaI2IFq5Ucw==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBlS0pyVGtTekV0MXQ5WHYy
+ MlRZYnVVaXdKVDlGNlZOekxUWng4NUlWTXlBCnBzbzNwUWtTdExBUXpCNy83YStm
+ Y0xvTlo5bkczS2xSdUtjenNjQlhDNlkKLS0tIGd6RjlZWGtZNVpXeVNpd0EyTk5h
+ cWN0b0dXQjNwNFZjdXdiUDZCUDZETkkKJlDzHxpRHbh4+LPEaWjrmiFFGMOL4Hdi
+ lMhSrn/EmMmf6p82FVpWMfr7fEFc9lCRw1VytKNUc1Le3nIpkM8iJQ==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1fl4rk54n2xv4vssjkw4nywy93s4yqv69uzq2f64zuwd8fjq5u4cq9wmmsw
+ lastmodified: "2026-06-22T19:17:43Z"
+ mac: ENC[AES256_GCM,data:o+p9xd02QZ9VcUwiAMAGExf5FBrDaKCkOen58d1zTzZuiH2Svcmg5xrA+N23XuEi9kVTcqby9fpymgTOlwNZn8JbmMYjLLiykBIWQvOPKNjAGzp2A9KFA1DpIzTegM+xXbnKv+FEZdRagAojkAUftUUzQYAUsmQVDnflzwNsSUI=,iv:s0oM+TgNNUgNZQ99Pb33UCUbhdZJ93Dv1X+GK6oFUwo=,tag:306d418MjlEZnPi6L2qd/g==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.13.1
diff --git a/hosts/sweetiepc/wg.nix b/hosts/sweetiepc/wg.nix
new file mode 100644
index 0000000..bf459d9
--- /dev/null
+++ b/hosts/sweetiepc/wg.nix
@@ -0,0 +1,7 @@
+{ config, pkgs, inputs, ... }: {
+ sops.secrets.wg0 = { sopsFile = ./resources/secrets/wg.yaml; key = "wg0"; };
+
+ networking.wg-quick.interfaces = {
+ wg0.configFile = config.sops.secrets.wg0.path;
+ };
+}
diff --git a/lib/default.nix b/lib/default.nix
new file mode 100644
index 0000000..01801a2
--- /dev/null
+++ b/lib/default.nix
@@ -0,0 +1,3 @@
+{
+ _mkProfileArchetype = import ./mkprofile.nix;
+}
diff --git a/lib/home-manager/default.nix b/lib/home-manager/default.nix
new file mode 100644
index 0000000..01801a2
--- /dev/null
+++ b/lib/home-manager/default.nix
@@ -0,0 +1,3 @@
+{
+ _mkProfileArchetype = import ./mkprofile.nix;
+}
diff --git a/lib/home-manager/mkprofile.nix b/lib/home-manager/mkprofile.nix
new file mode 100644
index 0000000..dae4d60
--- /dev/null
+++ b/lib/home-manager/mkprofile.nix
@@ -0,0 +1,9 @@
+profileName: nixosConfig: homeConfig: { config, lib, ... }: let
+ cfg = config._archetypes.profiles.${profileName};
+in {
+ options._archetypes.profiles.${profileName} = {
+ enable = lib.mkEnableOption "enable (standalone) home-manager profile ${profileName} for the configured user";
+ };
+
+ config = lib.mkIf cfg.enable (lib.mkMerge [ homeConfig ]);
+}
diff --git a/lib/mkprofile.nix b/lib/mkprofile.nix
new file mode 100644
index 0000000..c8cfe12
--- /dev/null
+++ b/lib/mkprofile.nix
@@ -0,0 +1,22 @@
+profileName: nixosConfig: homeConfig: { config, lib, ... }: let
+ cfg = config._archetypes.profiles.${profileName};
+ enabledUsers = lib.filterAttrs (user: userCfg: userCfg.enable) cfg.home.users;
+ homeConfigs = {
+ home-manager.users = lib.mapAttrs (user: userCfg: homeConfig) enabledUsers;
+ };
+in {
+ options._archetypes.profiles.${profileName} = {
+ enable = lib.mkEnableOption "enable nixos profile ${profileName}";
+ home.users = lib.mkOption {
+ type = lib.types.attrsOf (lib.types.submodule {
+ options = {
+ enable = lib.mkEnableOption "home-manager profile ${profileName} for user";
+ };
+ });
+ default = {};
+ description = "enable home-manager profile ${profileName} for user the specified user";
+ };
+ };
+
+ config = lib.mkIf cfg.enable (lib.mkMerge [ nixosConfig homeConfigs ]);
+}
diff --git a/modules/home/alacritty.nix b/modules/home/alacritty.nix
deleted file mode 100644
index f60fe01..0000000
--- a/modules/home/alacritty.nix
+++ /dev/null
@@ -1,67 +0,0 @@
-{ config, lib, ... }: {
- options = {
- alacritty = {
- enable = lib.mkEnableOption "enables creation of alacritty config file";
- font.size = lib.mkOption {
- type = lib.types.int;
- default = 12;
- };
- font.family = lib.mkOption {
- type = lib.types.str;
- default = "JetBrainsMonoNL Nerd Font Mono";
- };
- };
- };
-
- config = {
- programs.alacritty.enable = config.alacritty.enable;
- programs.alacritty.settings = lib.mkIf config.alacritty.enable {
- colors = {
- bright = {
- black = "#7f7f7f";
- blue = "#1578c1";
- cyan = "#00c4a3";
- green = "#2bb500";
- magenta = "#b14ff7";
- red = "#ed1207";
- white = "#ffffff";
- yellow = "#fc9700";
- };
- normal = {
- black = "#101010";
- blue = "#1578c1";
- cyan = "#00c4a3";
- green = "#2bb500";
- magenta = "#b14ff7";
- red = "#ed1207";
- white = "#ffffff";
- yellow = "#fc9700";
- };
- primary = {
- background = "#101010";
- foreground = "#ffffff";
- };
- };
- cursor.style.blinking = "Never";
- env.TERM = "xterm-256color";
- font = {
- size = config.alacritty.font.size;
- normal.family = config.alacritty.font.family;
- };
- mouse.bindings = [{
- action = "PasteSelection";
- mouse = "Right";
- }];
- window = {
- dynamic_padding = true;
- dynamic_title = true;
- title = "Terminal";
- # Pretend to be st
- class = {
- general = "st";
- instance = "st";
- };
- };
- };
- };
-}
diff --git a/modules/home/chrome.nix b/modules/home/chrome.nix
deleted file mode 100644
index 976a74b..0000000
--- a/modules/home/chrome.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ pkgs, lib, ... }: {
- programs.chromium = {
- enable = true;
- package = pkgs.ungoogled-chromium;
- };
- programs.chromium.extensions =
- let
- createChromiumExtensionFor = browserVersion: { id, sha256, version }:
- {
- inherit id;
- crxPath = builtins.fetchurl {
- url = "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=${browserVersion}&x=id%3D${id}%26installsource%3Dondemand%26uc";
- name = "${id}.crx";
- inherit sha256;
- };
- inherit version;
- };
- createChromiumExtension = createChromiumExtensionFor (lib.versions.major pkgs.ungoogled-chromium.version);
- in
- [
- (createChromiumExtension {
- # ublock origin
- id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
- sha256 = "sha256:1i0668xhq5iflb4fn0ghwp79iz6mwspgxdqwp6incbvsyzr596kg";
- version = "1.61.0";
- })
- ];
-}
diff --git a/modules/home/default.nix b/modules/home/default.nix
deleted file mode 100644
index b44f360..0000000
--- a/modules/home/default.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ lib, userDetails, ... }: {
- home = {
- username = userDetails.username;
- homeDirectory = userDetails.home.root;
- stateVersion = "24.05";
- };
-
- imports = [
- ./alacritty.nix
- #./chrome.nix
- ./firefox.nix
- ./git.nix
- ./gtk-bookmarks.nix
- ./htop.nix
- ./initial-home-setup.nix
- ./pcmanfm.nix # TODO mk name changeable & doesn't seem to work right now
- ./theme.nix
- ./wallpapers.nix
- ];
-
- alacritty.enable = lib.mkDefault true;
- theme.mint.enable = lib.mkDefault true;
- wallpapers.enable = lib.mkDefault false;
-}
diff --git a/modules/home/firefox.nix b/modules/home/firefox.nix
deleted file mode 100644
index 5e015ff..0000000
--- a/modules/home/firefox.nix
+++ /dev/null
@@ -1,80 +0,0 @@
-{ pkgs, userDetails, ... }: {
- programs.firefox = {
- # TODO see if there is way to login to moz account in profile
- enable = true;
- arkenfox = {
- enable = true;
- };
- profiles = let
- search = {
- engines = {
- "Timmy Search" = {
- urls = [{ template = "https://search.tjkeller.xyz/search?q={searchTerms}"; }]; # Don't know how to do w/ POST but I prefer GET anyways
- iconURI = "https://search.tjkeller.xyz/static/themes/simple/img/favicon.svg"; # TODO doesn't seem to work
- };
- "Nix Packages" = {
- urls = [{
- template = "https://search.nixos.org/packages";
- params = [
- { name = "type"; value = "packages"; }
- { name = "query"; value = "{searchTerms}"; }
- ];
- }];
-
- icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
- definedAliases = [ "@np" ];
- };
- };
- default = "Timmy Search";
- privateDefault = "Timmy Search";
- force = true; # Overwrite old
- };
- userChrome = builtins.readFile ./resources/firefox/userChrome.css;
- arkenfox = {
- enable = true;
- enableAllSections = true;
- "0100"."0102"."browser.startup.page".value = 3; # 0=blank, 1=home, 2=last visited page, 3=resume previous session
- "0100"."0103"."browser.startup.homepage".enable = false;
- "0100"."0104"."browser.newtabpage.enabled".enable = false;
- "2800"."2811"."privacy.clearOnShutdown.history".enable = false;
- };
- settings = {
- "browser.compactmode.show" = true;
- "browser.uiCustomization.state" = builtins.readFile ./resources/firefox/uiCustomization.json; # Toolbar etc.
- "browser.uidensity" = 1; # Compact
- "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # userchrome
-
- "app.normandy.first_run" = false;
- "browser.aboutConfig.showWarning" = false; # arkenfox does
- "browser.download.dir" = userDetails.home.downloads; # FF will create this dir if it doesn't exist
- "browser.newtabpage.activity-stream.feeds.section.topstories" = false;
- "browser.newtabpage.activity-stream.feeds.topsites" = false;
- "browser.urlbar.suggest.topsites" = false;
- "devtools.toolbox.host" = "window";
- "dom.push.enabled" = false; #
- "extensions.pocket.enabled" = false;
- "general.smoothScroll" = false;
- #identity.fxaccounts.account.device.name = "timmy’s Firefox on nixos"; # HOSTNAME
- };
- workSettings = settings // {
- "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; # Use builtin dark theme instead of system theme
- };
- in {
- Personal = {
- id = 0;
- isDefault = true;
- inherit search;
- inherit userChrome;
- inherit arkenfox;
- inherit settings;
- };
- Work = {
- id = 1;
- inherit search;
- inherit userChrome;
- inherit arkenfox;
- settings = workSettings;
- };
- };
- };
-}
diff --git a/modules/home/git.nix b/modules/home/git.nix
deleted file mode 100644
index 9d15a90..0000000
--- a/modules/home/git.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ userDetails, ... }: {
- programs.git = {
- enable = true;
- userName = userDetails.fullname;
- userEmail = userDetails.email;
- };
-}
diff --git a/modules/home/gtk-bookmarks.nix b/modules/home/gtk-bookmarks.nix
deleted file mode 100644
index 067543d..0000000
--- a/modules/home/gtk-bookmarks.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{ config, lib, userDetails, ... }: {
- options = {
- additional-gtk-bookmarks = lib.mkOption {
- type = with lib.types; listOf str;
- default = [];
- description = "gtk bookmarks for file managers, etc.";
- };
- };
-
- config = {
- gtk.gtk3.bookmarks = with userDetails; [
- "file://${home.downloads} Downloads"
- "file://${home.documents} Documents"
- "file://${home.pictures} Pictures"
- ] ++ config.additional-gtk-bookmarks;
- };
-}
diff --git a/modules/home/htop.nix b/modules/home/htop.nix
deleted file mode 100644
index 523fee8..0000000
--- a/modules/home/htop.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ config, ... }: {
- programs.htop.enable = true;
- programs.htop.settings = {
- fields = with config.lib.htop.fields; [
- PID
- USER
- 124 # EXE
- PERCENT_CPU
- PERCENT_MEM
- STARTTIME
- ELAPSED # time elapsed since process start
- IO_READ_RATE
- RBYTES # num read bytes
- IO_WRITE_RATE
- WBYTES # num written bytes
- TIME
- STIME # sys time
- CSTIME # child sys time
- NICE
- STATE
- PRIORITY
- 125 # CWD
- ];
- } // (with config.lib.htop; leftMeters [
- (bar "AllCPUs2")
- (bar "CPU")
- (bar "Memory")
- (bar "DiskIO")
- (bar "NetworkIO")
- ]) // (with config.lib.htop; rightMeters [
- (text "Hostname")
- (text "Clock")
- (text "Uptime")
- (text "Battery")
- (text "LoadAverage")
- (text "Tasks")
- ]);
-}
diff --git a/modules/home/initial-home-setup.nix b/modules/home/initial-home-setup.nix
deleted file mode 100644
index 046f5a5..0000000
--- a/modules/home/initial-home-setup.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ config, lib, pkgs, userDetails, ... }: {
- home.activation = {
- cloneRepos = lib.hm.dag.entryAfter ["writeBoundary"] ''
- export PATH="${config.home.path}/bin:$PATH"
- ${builtins.readFile ./resources/activation-scripts/clone-repos.sh}
- '';
- linkZshProfile = lib.hm.dag.entryAfter ["writeBoundary"] ''
- run ln -sf $VERBOSE_ARG $HOME/.config/zsh/zprofile $HOME/.zprofile
- '';
- cleanupHome = lib.hm.dag.entryAfter ["writeBoundary"] ''
- run rm -f $VERBOSE_ARG $HOME/{.zcompdump,.zshrc,.zsh_history,.bash_history}
- '';
- mimewiz = lib.hm.dag.entryAfter ["writeBoundary"] ''
- export PATH="${pkgs.xdg-utils}/bin:$PATH"
- export PATH="$HOME/.local/bin/misc:$PATH"
- run mimewiz -i # already verbose
- '';
- createDirs = lib.hm.dag.entryAfter ["writeBoundary"] ''
- run mkdir -p $VERBOSE_ARG "${userDetails.home.downloads}"
- '';
- };
-}
diff --git a/modules/home/pcmanfm.nix b/modules/home/pcmanfm.nix
deleted file mode 100644
index 3c70521..0000000
--- a/modules/home/pcmanfm.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- home.file.pcmanfm-root = {
- target = ".local/share/file-manager/actions/root.desktop";
- source = ./resources/pcmanfm/root.desktop;
- };
-}
diff --git a/modules/home/resources/activation-scripts/clone-repos.sh b/modules/home/resources/activation-scripts/clone-repos.sh
deleted file mode 100644
index 887968b..0000000
--- a/modules/home/resources/activation-scripts/clone-repos.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-server="https://git.tjkeller.xyz/"
-
-clonemissing() {
- # clone to $2
- [ -d "$2"/.git ] && return
- run mkdir -p $VERBOSE_ARG "$2"
- run git clone $VERBOSE_ARG "$server$1" "$2"
-
- # link to $3
- [ -z "$3" ] && return
- run mkdir -p $VERBOSE_ARG "$3"
- run ln -sf $VERBOSE_ARG "$2"/* "$3"
-}
-
-# # repo # clone to # link to
-clonemissing scripts $HOME/docs/src/scripts $HOME/.local/bin
-clonemissing dotconfig $HOME/docs/src/config $HOME/.config
-clonemissing userscripts $HOME/docs/src/userscripts ''
-clonemissing nixos $HOME/docs/src/nixos ''
-clonemissing awesome $HOME/.config/awesome ''
-clonemissing nvim $HOME/.config/nvim ''
-clonemissing zsh $HOME/.config/zsh ''
diff --git a/modules/home/resources/firefox/uiCustomization.json b/modules/home/resources/firefox/uiCustomization.json
deleted file mode 100644
index 339b716..0000000
--- a/modules/home/resources/firefox/uiCustomization.json
+++ /dev/null
@@ -1 +0,0 @@
-{"placements":{"widget-overflow-fixed-list":[],"unified-extensions-area":["ublock0_raymondhill_net-browser-action","sponsorblocker_ajay_app-browser-action","_e6e36c9a-8323-446c-b720-a176017e38ff_-browser-action","dearrow_ajay_app-browser-action","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","idcac-pub_guus_ninja-browser-action","addon_darkreader_org-browser-action","_74145f27-f039-47ce-a470-a662b129930a_-browser-action","_762f9885-5a13-4abd-9c77-433dcd38b8fd_-browser-action","jid1-bofifl9vbdl2zq_jetpack-browser-action","addon_fastforward_team-browser-action","jid1-tsgsxbhncspbwq_jetpack-browser-action","_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action"],"nav-bar":["back-button","forward-button","stop-reload-button","home-button","urlbar-container","downloads-button","unified-extensions-button"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["tabbrowser-tabs","new-tab-button","alltabs-button"],"PersonalToolbar":["personal-bookmarks"]},"seen":["save-to-pocket-button","developer-button","dearrow_ajay_app-browser-action","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","_e6e36c9a-8323-446c-b720-a176017e38ff_-browser-action","sponsorblocker_ajay_app-browser-action","ublock0_raymondhill_net-browser-action","idcac-pub_guus_ninja-browser-action","addon_darkreader_org-browser-action","_74145f27-f039-47ce-a470-a662b129930a_-browser-action","_762f9885-5a13-4abd-9c77-433dcd38b8fd_-browser-action","jid1-bofifl9vbdl2zq_jetpack-browser-action","addon_fastforward_team-browser-action","jid1-tsgsxbhncspbwq_jetpack-browser-action","_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action"],"dirtyAreaCache":["nav-bar","PersonalToolbar","unified-extensions-area","toolbar-menubar","TabsToolbar"],"currentVersion":20,"newElementCount":5}
diff --git a/modules/home/resources/firefox/userChrome.css b/modules/home/resources/firefox/userChrome.css
deleted file mode 100644
index de0e112..0000000
--- a/modules/home/resources/firefox/userChrome.css
+++ /dev/null
@@ -1,193 +0,0 @@
-/* TOP BAR */
-#navigator-toolbox {
- --uc-navigationbar-width: 40vw;
-}
-
-/* Remove overflow button */
-#nav-bar-overflow-button { display: none; }
-
-/* remove alltabs button */
-#alltabs-button { display: none; }
-
-/* Change background color of toolbar */
-#navigator-toolbox-background {
- background: var(--toolbar-field-border-color) !important;
-}
-
-/* Fix vertical spacing of tabs */
-#TabsToolbar {
- margin-top: -1px;
-}
-
-/* Move new tab to far right */
-#tabbrowser-arrowscrollbox-periphery {
- margin-left: auto;
-}
-
-/* Fix spacing around tabs by removing nav bar top border */
-#nav-bar {
- border: none !important;
-}
-
-/* Media queries for width of nav bar */
-@media screen and (max-width: 1000px) {
- #navigator-toolbox {
- --uc-navigationbar-width: 50vw;
- }
-}
-@media screen and (max-width: 800px) {
- #navigator-toolbox {
- --uc-navigationbar-width: 60vw;
- }
-}
-
-/* Change look of tabs in smaller view */
-@media screen and (max-width: 800px) {
- .tab-background {
- margin-block: .2em !important;
- }
- #TabsToolbar {
- margin-left: 5px;
- }
-}
-
-
-/* COMBINE TOP BAR */
-/* Combine top bar into single line if width >= 800px */
-@media screen and (min-width: 800px) {
- :root {
- --uc-toolbar-height: 36px; /* Half height bar */
- }
-
- /* Modify these to change relative widths or default height */
- #navigator-toolbox {
- margin-bottom: 0px;
- padding-top: 1px; /* Top bar is cut off otherwise */
- }
-
- #TabsToolbar {
- margin-left: calc(var(--uc-navigationbar-width) + 2px); /* Resize tab bar */
- margin-top: -4px;
- margin-bottom: 2px;
- }
-
- /* Tabs extend to bottom of bar */
- .tab-background {
- margin-bottom: 0 !important;
- margin-top: 3px !important; /* See above navigator-toolbox rule. Avoid cutting off top */
- }
-
- /* Center tab buttons */
- #tabs-newtab-button,
- #alltabs-button
- {
- margin-top: 4px !important;
- }
-
- /* Integrate url / nav bar */
- #nav-bar {
- margin-right:calc(100vw - var(--uc-navigationbar-width));
- margin-top: calc(0px - var(--uc-toolbar-height));
- border-radius: 0 var(--tab-border-radius) var(--tab-border-radius) 0;
- border-right: 1px solid ThreeDShadow !important;
- box-shadow: 0 0 4px rgba(0,0,0,.4) !important;
- }
-
- /* 1px margin on touch density causes tabs to be too high */
- .tab-close-button {
- margin-top: 0 !important
- }
-
- /* Make opened urlbar overlay the toolbar */
- #urlbar[open]:focus-within {
- min-width: 50vw !important;
- }
-
- /* Remove min and max width of urlbar */
- #urlbar-container {
- width: 0 !important;
- }
-
- /* Fix customization view */
- #customization-panelWrapper .panel-arrowbox .panel-arrow {
- margin-inline-end: initial !important;
- }
-
- /* Shorten findbar */
- findbar {
- width: 600px !important;
- border-radius: 0 0 0 5px;
- border-bottom: none !important;
- box-shadow: 0 2px 4px rgba(0,0,0,.4); /* Move down 2px so it doesn't go over the tab bar */
- }
-}
-
-
-/* FINDBAR */
-findbar {
- width: 100vw;
- position: absolute;
- top: 0;
- right: 0;
- padding: 0 !important;
- padding-top: 1px !important;
- background: -moz-headerbar Field !important;
- border-top-width: 0px !important;
- border-bottom: 1px solid ThreeDShadow;
-}
-
-findbar .findbar-container {
- padding-bottom: 5px !important; /* Move search bar closer to left edge */
- padding-top: 2px !important; /* Move search bar closer to left edge */
- height: max-content !important;
- gap: 2px;
- justify-content: space-between;
- flex-wrap: wrap;
-}
-
-/* Force textbox to fill up first line */
-findbar .findbar-textbox {
- width: 100% !important;
- background: Field !important; /* Set the background color to be consistent with found-matches label when unfocused */
-}
-
-/* Hide description showing wrap conditions etc. */
-findbar description {
- display: none;
-}
-
-/* Move found matches label (roughly) into the textbox */
-findbar label.found-matches,
-findbar description {
- position: absolute;
- top: 6.5px;
- right: 110px;
- color: color-mix(in srgb, -moz-headerbartext, transparent 46%) !important;
- /* So this text overrides the text below, TODO find a more elegant solution */
- padding-inline: 1ex;
- background: Field;
-}
-
-/* Show description when it says "Phrase Not Found" */
-findbar description[status=notfound] {
- display: inline-block;
-}
-
-/* Force checkboxes onto second line */
-findbar .findbar-container hbox {
- width: 100%;
-}
-
-
-/* BOOKMARK BAR */
-@-moz-document url(chrome://browser/content/browser.xhtml) {
- #PersonalToolbar {
- background: -moz-headerbar Field !important;
- border-top: 1px solid ThreeDShadow !important;
- z-index: 1000; /* To not be affected by shadow from navbar */
- }
- /* Space out bookmark items */
- .bookmark-item .toolbarbutton-text {
- padding: 2.5px 4px;
- }
-}
diff --git a/modules/home/theme.nix b/modules/home/theme.nix
deleted file mode 100644
index a1c4f9b..0000000
--- a/modules/home/theme.nix
+++ /dev/null
@@ -1,74 +0,0 @@
-{ config, lib, pkgs, ... }:
-let
- transformColorValue = color :
- if color == "Green" then "Mint-Y"
- else if color == "Dark-Green" then "Mint-Y-Dark"
- else "Mint-Y-${color}"
- ;
-in {
- options = {
- theme.mint = {
- enable = lib.mkEnableOption "enables mint theme";
- # TODO add theme.dark option instead of specifying Dark-Color
- theme.color = lib.mkOption {
- type = lib.types.enum [
- "Aqua" "Blue" "Green" "Grey" "Orange" "Pink" "Purple" "Red"
- "Sand" "Teal" "Dark-Aqua" "Dark-Blue" "Dark-Green"
- "Dark-Grey" "Dark-Orange" "Dark-Pink" "Dark-Purple"
- "Dark-Red" "Dark-Sand" "Dark-Teal"
- ];
- default = "Dark-Aqua";
- description = "mint-y theme color eg. 'Dark-Aqua' or 'Red'";
- };
- icons.color = lib.mkOption {
- type = lib.types.enum [
- "Aqua" "Blue" "Green" "Grey" "Orange" "Pink" "Purple" "Red"
- "Sand" "Teal"
- ];
- default = "Aqua";
- description = "mint-y icons color eg. 'Aqua' or 'Red'";
- };
- };
- theme.font = {
- sansSerif = lib.mkOption {
- type = lib.types.str;
- default = "Inter";
- description = "default sans serif font";
- };
- monospace = lib.mkOption {
- type = lib.types.str;
- default = "CommitMono";
- description = "default monospace font";
- };
- };
- };
-
- config = {
- gtk = {
- enable = true;
- theme = lib.mkIf config.theme.mint.enable {
- package = pkgs.mint-themes;
- name = transformColorValue config.theme.mint.theme.color;
- };
- iconTheme = lib.mkIf config.theme.mint.enable {
- package = pkgs.mint-y-icons;
- name = transformColorValue config.theme.mint.icons.color;
- };
- font = {
- name = config.theme.font.sansSerif;
- };
- cursorTheme = {
- name = "Adwaita";
- };
- gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
- };
- qt = {
- enable = true;
- platformTheme.name = "gtk3";
- };
- fonts.fontconfig.defaultFonts = {
- sansSerif = [ config.theme.font.sansSerif ];
- monospace = [ config.theme.font.monospace ];
- };
- };
-}
diff --git a/modules/home/wallpapers.nix b/modules/home/wallpapers.nix
deleted file mode 100644
index d7e067a..0000000
--- a/modules/home/wallpapers.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ lib, config, pkgs, ... }: {
- options = {
- wallpapers.enable = lib.mkEnableOption "enables all wallpapers";
- };
-
- config = lib.mkIf config.wallpapers.enable {
- home.file.".local/share/wallpaper" = {
- source = pkgs.fetchzip {
- url = "https://tjkeller.xyz/permalinks/wallpapers.tar";
- hash = "sha256-lhj9wUMZfd0XOrUtWY9HB64oXrS/EjsvsaJHzu4ucFg=";
- };
- };
- };
-}
diff --git a/modules/hosts/T430/configuration.nix b/modules/hosts/T430/configuration.nix
deleted file mode 100644
index 282515d..0000000
--- a/modules/hosts/T430/configuration.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ config, lib, pkgs, ... }: {
- imports = [ ./hardware-configuration.nix ];
- networking.hostName = "T430";
-
- # TODO this does not function
- #boot.initrd.systemd.extraBin = {
- # sh = "${pkgs.dash}/bin/dash";
- # vim = "${pkgs.neovim}/bin/nvim";
- #};
-
- # Open ports in the firewall.
- # networking.firewall.allowedTCPPorts = [ ... ];
- # networking.firewall.allowedUDPPorts = [ ... ];
- # Or disable the firewall altogether.
- # networking.firewall.enable = false;
-
- system.stateVersion = "24.05";
-}
diff --git a/modules/hosts/T430/home.nix b/modules/hosts/T430/home.nix
deleted file mode 100644
index 9885a06..0000000
--- a/modules/hosts/T430/home.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ ... }: {
- imports = [ ../../home ];
-
- alacritty.font.size = 9;
- wallpapers.enable = true;
-}
diff --git a/modules/hosts/T495/configuration.nix b/modules/hosts/T495/configuration.nix
deleted file mode 100644
index 526b7bb..0000000
--- a/modules/hosts/T495/configuration.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ config, lib, pkgs, ... }: {
- imports = [
- ./hardware-configuration.nix
- ./games.nix
- ./input-leap.nix
- ./wg.nix
- ];
- networking.hostName = "T495";
-
- bootloader.mode = "efi";
-
- # Enable extra software pkgs
- software.desktop = {
- chromium.enable = true;
- cad.enable = true;
- crypto.enable = true;
- graphics.enable = true;
- office.enable = true;
- utilities.enable = true;
- };
- software.development = {
- docker.enable = true;
- };
-
- # Enable network drives
- nas.enable = true;
- nas.office.enable = true;
- nas.office.automount = false;
-
- networking.hosts = {
- "192.168.77.3" = [ "devel" ];
- };
-
- # Use amdgpu driver for x11
- services.xserver.videoDrivers = [ "amdgpu" ];
-
- # Enable bluetooth
- bluetooth.enable = true;
-
- system.stateVersion = "24.05";
-}
diff --git a/modules/hosts/T495/games.nix b/modules/hosts/T495/games.nix
deleted file mode 100644
index 419d854..0000000
--- a/modules/hosts/T495/games.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ pkgs, ... }: {
- nixpkgs.config.allowUnfree = true;
- environment.systemPackages = with pkgs; [
- #vintagestory
- prismlauncher
- ];
-}
diff --git a/modules/hosts/T495/home.nix b/modules/hosts/T495/home.nix
deleted file mode 100644
index 817b0c0..0000000
--- a/modules/hosts/T495/home.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{ ... }: {
- imports = [ ../../home ];
-
- theme.mint.theme.color = "Dark-Purple";
- theme.mint.icons.color = "Purple";
- wallpapers.enable = true;
-
- home.file.input-leap-config = {
- source = ./resources/input-leap;
- recursive = true;
- target = "./.config/input-leap";
- };
-}
diff --git a/modules/hosts/T495/input-leap.nix b/modules/hosts/T495/input-leap.nix
deleted file mode 100644
index cf6d018..0000000
--- a/modules/hosts/T495/input-leap.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ pkgs, ... }: {
- environment.systemPackages = with pkgs; [
- input-leap
- ];
-
- networking.firewall = {
- allowedTCPPorts = [
- 24800 # input-leaps
- ];
- };
-}
diff --git a/modules/hosts/T495/resources/input-leap/input-leap.conf b/modules/hosts/T495/resources/input-leap/input-leap.conf
deleted file mode 100644
index c2d5176..0000000
--- a/modules/hosts/T495/resources/input-leap/input-leap.conf
+++ /dev/null
@@ -1,12 +0,0 @@
-section: screens
- T495:
- optiplex:
-end
-
-section: links
- T495:
- up = optiplex
-
- optiplex:
- down = T495
-end
diff --git a/modules/hosts/T495/resources/secrets/wg0.yaml b/modules/hosts/T495/resources/secrets/wg0.yaml
deleted file mode 100644
index 6df5ff6..0000000
--- a/modules/hosts/T495/resources/secrets/wg0.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-wg0: ENC[AES256_GCM,data:Zxw98YrH2QYyU8u4sk0geOUQXfOZK9scGPECbKruehcDffJlRspmsS2k3sSahdAIcJjIjauGmZ7usXus2wKAiRnYsl2e4P/0IUVp8L8UJp52iPZVEvT9JRELPYQ9gBBNmp/HDYglxP7uHx2bzcCTvCr4fFdQZgsUSl/pd6pBtSMwupsK5U9Xfz9Sh7JNTlpgpU4jlkl676XnrCo0HyL7rXMp4S6Ruhfve8gwJYP8QLn4DiwnP69Flc54MDQRKSvlvYca8dZIrS1N3h9k6aO1eB/z4I3qPN0/p7yT9pdfemaDpEqf1+byRKGYuED1Ge8P3D0+qRWJBd5GmoSHC8NV9KVV3DrAJ/QLOLCqm8oN0UGxQW5lbWi6lIQ708kodEDOsBREexRPOzjYAjajBr6O6wCtRThgce4yOg9ZwqxVDERqIz1fR034b56LrZtKjOSlJtmkmMCuCGrVkKj4L7JvBfKtCjBN+TOyONsClY/Vhd+XzNWWk8d8FVraOE2rJN4+ss7UL+jBth3DfSbr739cEQDhHRKoMPvXy0FhPVw=,iv:CN82pOBNCtICzM0Ac9Gh+x8pUSK1Fc2v2KmM+de3A78=,tag:KuGiC+Ak550d6njSdX4muA==,type:str]
-sops:
- kms: []
- gcp_kms: []
- azure_kv: []
- hc_vault: []
- age:
- - recipient: age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
- enc: |
- -----BEGIN AGE ENCRYPTED FILE-----
- YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB4NEN4NGxDR1oreGVoSGhE
- TzMxSEY0QVBhS2Z6MW15ci9aVlJ0a3IyVlZBCldPRVNvcUhJSHhWSEk3akd4RjN0
- ajhUV2d1ZWRsRFU4cTE2dGl6RmM4MGsKLS0tIFhnUjl5aDJqWVB1NE15SlNzR2Iv
- YTNydURsOUMrSXZGdk9UOUdUQlA0SFUKxEDJRR6tpYva9qpWo9NxwCxk/xpRVoTl
- YJkmDZzMcXikXXiro96AprP9dXJXvMPKYPGl2Zsal8PlGFPBoHW2GA==
- -----END AGE ENCRYPTED FILE-----
- lastmodified: "2025-01-05T18:21:12Z"
- mac: ENC[AES256_GCM,data:VEtpQLHMoQK7Qg4PT2DkNNMurjRE0ZadyiQ0uYsPJ0K2lS0gD8pPwb8btiq7KXXOGWWZOMYRDaRKOENy44f/k+16GOpO6jaKAfN6eEcidaWlP7zvpeNzt7LImFqn/Sjv4rq1+DmvGxyyNjuK8BwvvAfnZwG6KXbn7Bh6xgfTnLs=,iv:Jf4f5j6BTkDBmah3izIESsAn7wDMUFU6NbsqpFIdui4=,tag:yNg374unwHaDEK43+Y0eWg==,type:str]
- pgp: []
- unencrypted_suffix: _unencrypted
- version: 3.9.2
diff --git a/modules/hosts/hp-envy-office/configuration.nix b/modules/hosts/hp-envy-office/configuration.nix
deleted file mode 100644
index 9a7a43a..0000000
--- a/modules/hosts/hp-envy-office/configuration.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ config, lib, pkgs, ... }: {
- imports = [
- ./hardware-configuration.nix
- ];
- networking.hostName = "hp-envy-office";
-
- # Enable extra software pkgs
- software.desktop = {
- chromium.enable = true;
- cad.enable = false;
- crypto.enable = false;
- graphics.enable = true;
- office.enable = true;
- utilities.enable = true;
- };
- software.development = {
- docker.enable = true;
- };
-
- # Enable network drives
- nas.enable = true;
- nas.office.enable = true;
- nas.home.enable = false;
-
- networking.hosts = {
- "192.168.77.3" = [ "devel" ];
- };
-
- # Use amdgpu driver for x11
- services.xserver.videoDrivers = [ "amdgpu" ];
-
- # Enable bluetooth
- bluetooth.enable = true;
-
- # Disable autologin
- autologin.enable = false;
-
- system.stateVersion = "24.11";
-}
diff --git a/modules/hosts/hp-envy-office/home.nix b/modules/hosts/hp-envy-office/home.nix
deleted file mode 100644
index ed02130..0000000
--- a/modules/hosts/hp-envy-office/home.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ userDetails, ... }: {
- imports = [ ../../home ];
-
- theme.mint.theme.color = "Dark-Green";
- theme.mint.icons.color = "Green";
- wallpapers.enable = true;
-
- additional-gtk-bookmarks = with userDetails; [
- "file://${home.documents}/src/sites/admin Admin"
- "file:///media/chexx/chexx cHEXx"
- ];
-}
diff --git a/modules/hosts/libreX60/configuration.nix b/modules/hosts/libreX60/configuration.nix
deleted file mode 100644
index 942793d..0000000
--- a/modules/hosts/libreX60/configuration.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ config, lib, pkgs, ... }: {
- imports = [ ./hardware-configuration.nix ];
- networking.hostName = "libreX60";
-
- # Enable extra software pkgs
- software.desktop = {
- office.enable = true;
- };
-
- # Enable network drives
- nas.enable = true;
-
- system.stateVersion = "24.11";
-}
diff --git a/modules/hosts/libreX60/home.nix b/modules/hosts/libreX60/home.nix
deleted file mode 100644
index 453bfd6..0000000
--- a/modules/hosts/libreX60/home.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{ ... }: {
- imports = [ ../../home ];
-
- theme.mint.theme.color = "Dark-Red";
- theme.mint.icons.color = "Red";
- theme.font.sansSerif = "Tamzen";
- theme.font.monospace = "Tamzen";
-}
diff --git a/modules/hosts/optiplex/configuration.nix b/modules/hosts/optiplex/configuration.nix
deleted file mode 100644
index cbde612..0000000
--- a/modules/hosts/optiplex/configuration.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{ config, lib, pkgs, ... }: {
- imports = [
- ./hardware-configuration.nix
- ];
- networking.hostName = "optiplex";
-
- bootloader.mode = "efi";
-
- # Allow unfree for nvidia + others
- nixpkgs.config.allowUnfree = true;
-
- # Enable extra software pkgs
- software.desktop = {
- chromium.enable = true;
- cad.enable = true;
- crypto.enable = true;
- graphics.enable = true;
- office.enable = true;
- utilities.enable = true;
- };
-
- # Install more programs
- environment.systemPackages = with pkgs; [
- prismlauncher
- spotify
- #vintagestory
- ];
-
- # Enable network drives
- nas.enable = true;
-
- # Disable wifi
- wifi.enable = false;
-
- networking.hosts = {
- "192.168.77.3" = [ "devel" ];
- };
-
- # Use nvidia driver
- services.xserver.videoDrivers = [ "nvidia" ];
- hardware.nvidia = {
- modesetting.enable = true; # Required
- powerManagement.enable = false; # Can cause bugs
- nvidiaSettings = true;
- open = false; # Not compatible w/ GTX-1050
- package = config.boot.kernelPackages.nvidiaPackages.stable; # Still good for 1050
- };
-
- system.stateVersion = "24.11";
-}
diff --git a/modules/hosts/optiplex/home.nix b/modules/hosts/optiplex/home.nix
deleted file mode 100644
index ee56dc6..0000000
--- a/modules/hosts/optiplex/home.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ ... }: {
- imports = [ ../../home ];
-
- theme.mint.theme.color = "Dark-Green";
- theme.mint.icons.color = "Green";
- wallpapers.enable = true;
-}
diff --git a/modules/root/autologin.nix b/modules/root/autologin.nix
deleted file mode 100644
index 6e66160..0000000
--- a/modules/root/autologin.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{ lib, config, userDetails, ... }: {
- options = {
- autologin.enable = lib.mkEnableOption "enables getty automatic login";
- #autologin.user = lib.mkEnableOption "populate username";
- #autologin.password = lib.mkEnableOption "populate password";
- };
-
- config = lib.mkIf config.autologin.enable {
- services.getty = {
- autologinUser = userDetails.username;
- };
- };
-}
diff --git a/modules/root/bluetooth.nix b/modules/root/bluetooth.nix
deleted file mode 100644
index d55eade..0000000
--- a/modules/root/bluetooth.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{ lib, config, ... }: {
- options = {
- bluetooth.enable = lib.mkEnableOption "enables bluetooth support";
- };
-
- config = {
- hardware.bluetooth.enable = true;
- services.blueman.enable = true;
- };
-}
diff --git a/modules/root/bootloader.nix b/modules/root/bootloader.nix
deleted file mode 100644
index 0a45264..0000000
--- a/modules/root/bootloader.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ lib, config, ... }: {
- options = {
- bootloader.loader = lib.mkOption {
- type = lib.types.enum [ "grub" "systemd-boot" ];
- default = "systemd-boot";
- description = "whether to install grub or systemd-boot as the bootloader";
- };
- bootloader.mode = lib.mkOption {
- type = lib.types.enum [ "efi" "bios" ];
- default = "efi";
- description = "whether to install the bootloader in efi or bios mode";
- };
- bootloader.grub = {
- biosDevice = lib.mkOption {
- type = lib.types.str;
- description = "device to install grub on";
- };
- };
- bootloader.memtest86.enable = lib.mkEnableOption "make Memtest86+ available from the bootloader";
- };
-
- config = {
- boot.loader = {
- grub = {
- enable = config.bootloader.loader == "grub";
- efiSupport = config.bootloader.mode == "efi";
- efiInstallAsRemovable = config.bootloader.mode == "efi";
- device = if config.bootloader.mode == "bios" then config.bootloader.grub.biosDevice else "nodev";
- enableCryptodisk = true;
- memtest86.enable = config.bootloader.memtest86.enable;
- };
- systemd-boot = {
- enable = config.bootloader.loader == "systemd-boot";
- editor = false;
- memtest86.enable = config.bootloader.memtest86.enable;
- };
- efi = lib.mkIf (config.bootloader.mode == "efi") {
- efiSysMountPoint = lib.mkIf (config.bootloader.loader == "grub") "/boot/efi";
- canTouchEfiVariables = true;
- };
- };
- };
-}
diff --git a/modules/root/default.nix b/modules/root/default.nix
deleted file mode 100644
index e108318..0000000
--- a/modules/root/default.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{ lib, ... }: {
- imports = [
- ./software
- ./autologin.nix
- ./bluetooth.nix
- ./bootloader.nix
- ./doas.nix
- ./fonts.nix
- ./home-manager.nix
- ./hosts.nix
- ./localization.nix
- ./nas.nix
- ./nix.nix
- ./normaluser.nix
- ./pipewire.nix
- ./powerkeys.nix
- ./printing.nix
- ./secrets.nix
- ./ssh.nix
- ./tlp.nix
- ./wifi.nix
- ./x11.nix
- ./zsh.nix
- ];
-
- autologin.enable = lib.mkDefault true;
- avahi.enable = lib.mkDefault true;
- bluetooth.enable = lib.mkDefault false;
- doas.enable = lib.mkDefault true;
- fonts.enable = lib.mkDefault true;
- nas = {
- enable = lib.mkDefault false;
- home.enable = lib.mkDefault true;
- home.automount = lib.mkDefault false;
- office.enable = lib.mkDefault false;
- office.automount = lib.mkDefault false;
- };
- bootloader = {
- mode = lib.mkDefault "bios";
- memtest86.enable = lib.mkDefault true;
- };
- home-manager.enable = lib.mkDefault true;
- pipewire.enable = lib.mkDefault true;
- printing.enable = lib.mkDefault true;
- tlp.enable = lib.mkDefault true;
- scanning.enable = lib.mkDefault true;
- wifi.enable = lib.mkDefault true;
- xserver.enable = lib.mkDefault true;
- zsh.enable = lib.mkDefault true;
-}
diff --git a/modules/root/doas.nix b/modules/root/doas.nix
deleted file mode 100644
index c6707ce..0000000
--- a/modules/root/doas.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ lib, config, ... }: {
- options = {
- doas.enable = lib.mkEnableOption "enables doas";
- sudo.enable = lib.mkEnableOption "enables sudo";
- };
-
- config = {
- security = {
- #sudo.enable = config.sudo.enable;
- sudo.enable = true; # TODO remove once can be built from flake w git
- sudo.wheelNeedsPassword = false;
- doas.enable = config.doas.enable;
- doas.extraRules = lib.mkIf config.doas.enable [{
- keepEnv = true;
- }];
- doas.wheelNeedsPassword = false;
- };
- };
-}
diff --git a/modules/root/fonts.nix b/modules/root/fonts.nix
deleted file mode 100644
index 3ae8eef..0000000
--- a/modules/root/fonts.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ pkgs, lib, config, ... }: {
- options = {
- fonts.enable = lib.mkEnableOption "enables fonts";
- };
-
- config = lib.mkIf config.fonts.enable {
- fonts.packages = with pkgs; [
- commit-mono
- inter
- tamzen
- (nerdfonts.override {
- fonts = [ "JetBrainsMono" ];
- })
- ];
- };
-}
diff --git a/modules/root/home-manager.nix b/modules/root/home-manager.nix
deleted file mode 100644
index d271523..0000000
--- a/modules/root/home-manager.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ pkgs, lib, config, ... }: {
- options = {
- home-manager.enable = lib.mkEnableOption "enables home-manager";
- };
-
- config = lib.mkIf config.home-manager.enable {
- environment.systemPackages = with pkgs; [
- home-manager
- ];
- };
-}
diff --git a/modules/root/hosts.nix b/modules/root/hosts.nix
deleted file mode 100644
index 14daaf1..0000000
--- a/modules/root/hosts.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- networking.hosts = {
- "192.168.1.9" = [ "optiplex" ];
- "192.168.1.30" = [ "localgit" ];
- "192.168.1.11" = [ "truenas-home" ];
- "192.168.77.11" = [ "truenas-office" ];
- "192.168.77.8" = [ "publicgit" "tjkeller" ];
- "173.9.253.3" = [
- "git.tjkeller.xyz"
- "piped.tjkeller.xyz"
- "search.tjkeller.xyz"
- "tjkeller.xyz"
- ];
- };
-}
diff --git a/modules/root/localization.nix b/modules/root/localization.nix
deleted file mode 100644
index 8313f07..0000000
--- a/modules/root/localization.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- time.timeZone = "America/Chicago";
- i18n.defaultLocale = "en_US.UTF-8";
- services.xserver.xkb.layout = "us";
-}
diff --git a/modules/root/nas.nix b/modules/root/nas.nix
deleted file mode 100644
index 0116ba3..0000000
--- a/modules/root/nas.nix
+++ /dev/null
@@ -1,36 +0,0 @@
-{ lib, config, ... } :
-let
- mkNetworkFileSystem = device: automount: {
- device = "${device}";
- fsType = "nfs";
- options = [ "defaults" ] ++ lib.optionals (!automount) [ "noauto" ];
- };
-in {
- options = {
- nas = {
- enable = lib.mkEnableOption "enable network shares";
- home = {
- enable = lib.mkEnableOption "enable home network shares";
- automount = lib.mkEnableOption "automount home network shares";
- };
- office = {
- enable = lib.mkEnableOption "enable office network shares";
- automount = lib.mkEnableOption "automount home network shares";
- };
- };
- };
-
- config = lib.mkIf config.nas.enable {
- fileSystems = lib.optionalAttrs config.nas.home.enable {
- "/media/Storage/Media" = mkNetworkFileSystem "truenas-home:/mnt/Storage/Media" config.nas.home.automount;
- "/media/Storage/Backups" = mkNetworkFileSystem "truenas-home:/mnt/Storage/Backups" config.nas.home.automount;
- "/media/Storage/Tapes" = mkNetworkFileSystem "truenas-home:/mnt/Storage/Backups/Tapes" config.nas.home.automount;
- "/media/Family Photos" = mkNetworkFileSystem "truenas-home:/mnt/Media/Photos" config.nas.home.automount;
- } // lib.optionalAttrs config.nas.office.enable {
- "/media/chexx/chexx" = mkNetworkFileSystem "truenas-office:/mnt/Storage/chexx" config.nas.office.automount;
- "/media/chexx/tkdocs" = mkNetworkFileSystem "truenas-office:/mnt/Storage/Users/Tim-Keller" config.nas.office.automount;
- "/media/chexx/scans" = mkNetworkFileSystem "truenas-office:/mnt/Storage/Scans" config.nas.office.automount;
- };
- # TODO auto mkdirz
- };
-}
diff --git a/modules/root/normaluser.nix b/modules/root/normaluser.nix
deleted file mode 100644
index fc243ea..0000000
--- a/modules/root/normaluser.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ config, userDetails, ... }: {
- users.users.root = {
- hashedPasswordFile = config.sops.secrets.hashed-root-password.path;
- };
- users.users.${userDetails.username} = {
- description = userDetails.fullname;
- #home = userDetails.home.root;
- isNormalUser = true;
- hashedPasswordFile = config.sops.secrets.hashed-root-password.path;
- extraGroups = [ "wheel" "nixbld" ];
- };
-}
diff --git a/modules/root/pipewire.nix b/modules/root/pipewire.nix
deleted file mode 100644
index fd97d42..0000000
--- a/modules/root/pipewire.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ lib, config, ... }: {
- options = {
- pipewire.enable = lib.mkEnableOption "enables pipewire";
- };
-
- config = lib.mkIf config.pipewire.enable {
- services.pipewire = {
- enable = true;
- pulse.enable = true;
- };
- };
-}
diff --git a/modules/root/powerkeys.nix b/modules/root/powerkeys.nix
deleted file mode 100644
index fd4aa00..0000000
--- a/modules/root/powerkeys.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- services.logind = {
- hibernateKey = "suspend";
- powerKey = "ignore";
- powerKeyLongPress = "poweroff";
- };
-}
diff --git a/modules/root/resources/secrets/secrets.yaml b/modules/root/resources/secrets/secrets.yaml
deleted file mode 100644
index 03f9517..0000000
--- a/modules/root/resources/secrets/secrets.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-wpa_supplicant-conf: ENC[AES256_GCM,data:0FI1Re1PbiJmtsqb5Ddj1g/e22FkSOxHtbhchybFJAn1Q6PBYpMM/myMUQqZDqCNDhR8f+b2LYcrFx+c9g+yDsR9VcgVe/NK1U5jvep5go3JIibR0NmtfPVZNMvThmVnzO+6aGtggjN8PTx4nm+GKzf7YZPV/buYRdWExJRf0loXgNM8iLtjnu1QGZjWNBtFGbTRHeiax1QhvPrawp76PNrdpzD3EkY26HZ2TRfXFP8ta93T43sac9iVj+U3ggn9MTNvLDGiOF1lAN/W69EeCnyzw3sbxCsuSYFQ4GKkggaehje58VpsG7rZMIHYhI6PQcctO6WUupBi80KcBCnQQKy0Pir7GUPwhw1NPKuOgTX9Otz1dXxJgNk+gA4NTmyCWh2LO0utW0bjAAoqhn5sti5TssxqT2q+bw8KiAqRMZKyj8JDKg4cpMCVUbSH4fcIK1ADXa0OzItgVZnhEKJeD0SYqScXoRlExiDxHG/yrYuJYKtUQSrYJXjJJcTreTyMXWUh1E/nvS7egnXFMYYxDdTvJ5bQ/Zp94FI+twhNfMxKF5qo2gcGUHjQu/M=,iv:LKr6fcQ2emSjQmEt1HgyLpFLg4ZxDOVgJEfkm4nQzbY=,tag:M+oo8dpWclIRaPyW17Ldwg==,type:str]
-hashed-root-password: ENC[AES256_GCM,data:KUoB8Z0ifh7lE9ir9AqkiMRHfw6rusXw3KC1dLIRd4YpbTiNI+cAdC474LR721+LNWoj5ZytSdDsVyS+t3o076rV4sgWgL17jPPf+H2KE5FOmQKYTUiHfSBsLKyyhpie4tpFJWv/3cCW8Q==,iv:0sZPz3V7IqTGbF3Fnm+FbgBS3GTnHsRx0OzIoAE1H64=,tag:H6CQlANfiD6ZuQhONKyMAQ==,type:str]
-sops:
- kms: []
- gcp_kms: []
- azure_kv: []
- hc_vault: []
- age:
- - recipient: age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
- enc: |
- -----BEGIN AGE ENCRYPTED FILE-----
- YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAvTUlBZXQ5Z080UUxoUGdr
- dm9hRE5uTzFwWXhOWkJnbXNvazd1UnplcUdZCnRKQ3RVT1RGZURLYUxINStBSU4x
- bUZudFp2SC9DSkVhNTRHV0MrRFFMckEKLS0tIGNBb3FLQVJsTGVsY3hMdy94WWZx
- UkJ1SGJrWXNtbmlmc2c4M1IxdUpVOWMKjaakq+n8ZijGjaNVM8/dQApaVFp9+q3K
- nhvon4p5KUFE+myABnEknaSZ5UcvW6ZLff9AB7l35NZhGXAhv+y6HA==
- -----END AGE ENCRYPTED FILE-----
- lastmodified: "2025-01-09T16:42:38Z"
- mac: ENC[AES256_GCM,data:LUBRGB/NdT2Lvrecb4w3Xbq4ulMyhHwNjuGyH/fjFJOcNfOCNmwaxIRN59CBi65UxGe93mgYYKJtbCKUZA9JhEfC81e+wkD0ZpEaNBu2YAYetf6hE9LqlYO05QIf/qwXySkCXRKdDl5afcmBVXTj+6qDEljkGtWX7CPLlodvuSQ=,iv:EfYL215e52Ir3SSTba7WGFSTQHgtqzyfWUWTBS+lwrU=,tag:VjE1o7WCT/PWIxk2/b/eow==,type:str]
- pgp: []
- unencrypted_suffix: _unencrypted
- version: 3.9.2
diff --git a/modules/root/resources/x11/xinit-startx-xdg.patch b/modules/root/resources/x11/xinit-startx-xdg.patch
deleted file mode 100644
index c1bca97..0000000
--- a/modules/root/resources/x11/xinit-startx-xdg.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/startx.cpp b/startx.cpp
-index dfbebe1..472a1b0 100644
---- a/startx.cpp
-+++ b/startx.cpp
-@@ -272,7 +272,7 @@ if [ x"$enable_xauth" = x1 ] ; then
- dummy=0
-
- XCOMM create a file with auth information for the server. ':0' is a dummy.
-- xserverauthfile=$HOME/.serverauth.$$
-+ xserverauthfile="${XAUTHORITY:-$HOME/.Xauthority}"
- trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP BUS TERM
- xauth -q -f "$xserverauthfile" << EOF
- add :$dummy . $mcookie
-
diff --git a/modules/root/software/awesome.nix b/modules/root/software/awesome.nix
deleted file mode 100644
index fdc86e8..0000000
--- a/modules/root/software/awesome.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ pkgs, lib, config, ... }: {
- options = {
- xserver.awesome.enable = lib.mkEnableOption "enables awesomewm";
- };
-
- config = lib.mkIf (config.xserver.enable && config.xserver.awesome.enable ) {
- services.xserver.windowManager.awesome = {
- enable = true;
- noArgb = true; # disables transparency. why not?
- luaModules = with pkgs.luajitPackages; [
- lgi
- ];
- package = with pkgs; awesome.override {
- gtk3Support = true;
- gtk3 = gtk3;
- lua = luajit;
- };
- };
- };
-}
diff --git a/modules/root/software/default.nix b/modules/root/software/default.nix
deleted file mode 100644
index 8d1e987..0000000
--- a/modules/root/software/default.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ lib, config, ... }: {
- imports = [
- ./awesome.nix
- ./ddcutil.nix
- ./desktop.nix
- ./development.nix
- ./docker.nix
- ./system.nix
- ./utilities.nix
- ./virtualisation.nix
- ];
-
- software.desktop = {
- enable = lib.mkDefault config.xserver.enable;
- chromium.enable = lib.mkDefault false;
- cad.enable = lib.mkDefault false;
- crypto.enable = lib.mkDefault false;
- firefox.enable = lib.mkDefault true;
- graphics.enable = lib.mkDefault false;
- office.enable = lib.mkDefault false;
- utilities.enable = lib.mkDefault false;
- };
-
- software.development = {
- enable = lib.mkDefault true;
- docker = {
- enable = lib.mkDefault false;
- btrfsSupport = lib.mkDefault true;
- };
- };
-
- virtualisation.enable = lib.mkDefault false;
- xserver.awesome.enable = lib.mkDefault true;
-}
diff --git a/modules/root/software/derivations b/modules/root/software/derivations
deleted file mode 120000
index a075779..0000000
--- a/modules/root/software/derivations
+++ /dev/null
@@ -1 +0,0 @@
-../../../derivations \ No newline at end of file
diff --git a/modules/root/software/desktop.nix b/modules/root/software/desktop.nix
deleted file mode 100644
index 88101d8..0000000
--- a/modules/root/software/desktop.nix
+++ /dev/null
@@ -1,79 +0,0 @@
-{ pkgs, lib, config, ... }: {
- options = {
- software.desktop = {
- enable = lib.mkEnableOption "enables desktop apps";
- chromium = {
- enable = lib.mkEnableOption "enables selected chromium browser package";
- package = lib.mkOption {
- type = lib.types.package;
- default = pkgs.ungoogled-chromium;
- description = "chromium package to install";
- };
- };
- cad.enable = lib.mkEnableOption "enables cad and 3d printing apps";
- crypto.enable = lib.mkEnableOption "enables crypto wallet apps";
- firefox.enable = lib.mkEnableOption "enables firefox";
- graphics.enable = lib.mkEnableOption "enables graphic design apps";
- office.enable = lib.mkEnableOption "enables office apps";
- utilities.enable = lib.mkEnableOption "enables miscellaneous utility apps";
- };
- };
-
- config = lib.mkIf config.software.desktop.enable {
- environment.systemPackages = with pkgs; [
- # Default
- arandr
- dmenu
- libnotify
- mpv
- pavucontrol
- pcmanfm
- redshift
- scrot
- sxiv
- wpa_supplicant_gui
- zathura
- (callPackage ./derivations/st {})
- ] ++ pkgs.lib.optionals config.software.desktop.chromium.enable [
- # Chrome
- config.software.desktop.chromium.package
- ] ++ pkgs.lib.optionals config.software.desktop.cad.enable [
- # CAD
- blender
- freecad
- prusa-slicer
- ] ++ pkgs.lib.optionals config.software.desktop.crypto.enable [
- # Crypto Wallets
- bisq2
- electrum
- monero-gui
- ] ++ pkgs.lib.optionals config.software.desktop.graphics.enable [
- # Graphics
- blender
- geeqie
- gimp
- inkscape
- ] ++ pkgs.lib.optionals config.software.desktop.office.enable [
- # Office
- libreoffice
- pdfchain
- thunderbird
- ] ++ pkgs.lib.optionals config.software.desktop.utilities.enable [
- # Misc Utilities
- jellyfin-mpv-shim
- qbittorrent
- qdirstat
- remmina
- ];
-
- programs.localsend.enable = config.software.desktop.utilities.enable; # Installs & opens firewall
- programs.firefox.enable = config.software.desktop.firefox.enable;
-
- # GVfs allows for mounting drives in a graphical file manager
- services.gvfs.enable = true;
-
- # For home-manager to configure gtk
- # TODO this should be there instead
- programs.dconf.enable = config.software.desktop.enable;
- };
-}
diff --git a/modules/root/software/development.nix b/modules/root/software/development.nix
deleted file mode 100644
index 2a4dfba..0000000
--- a/modules/root/software/development.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ pkgs, lib, config, ... }: {
- options = {
- software.development.enable = lib.mkEnableOption "enables development tools";
- };
-
- config = lib.mkIf config.software.development.enable {
- environment.systemPackages = with pkgs; [
- adb-sync
- android-tools
- gcc
- git
- gnumake
- hugo
- lua
- pkg-config
- ];
- };
-}
diff --git a/modules/root/software/docker.nix b/modules/root/software/docker.nix
deleted file mode 100644
index bf1898c..0000000
--- a/modules/root/software/docker.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ pkgs, lib, config, userDetails, ... }: {
- options = {
- software.development.docker = {
- enable = lib.mkEnableOption "enables docker";
- btrfsSupport = lib.mkEnableOption "changes docker storageDriver to btrfs";
- };
- };
-
- config = lib.mkIf config.software.development.docker.enable {
- virtualisation.docker = {
- enable = true;
- storageDriver = lib.mkIf config.software.development.docker.btrfsSupport "btrfs";
- };
-
- environment.systemPackages = with pkgs; [
- docker-compose
- ];
-
- users.groups.docker.members = [ userDetails.username ];
- };
-}
diff --git a/modules/root/software/system.nix b/modules/root/software/system.nix
deleted file mode 100644
index f0a31f2..0000000
--- a/modules/root/software/system.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{ pkgs, ... }: {
- environment.systemPackages = with pkgs; [
- age # Secrets
- cryptsetup
- dash # TODO should be default /bin/sh
- exfat
- git # Needed for home-manager
- python3
- sops # Secrets
- ];
-
- services.gpm.enable = true;
-}
diff --git a/modules/root/software/virtualisation.nix b/modules/root/software/virtualisation.nix
deleted file mode 100644
index 4ae15f5..0000000
--- a/modules/root/software/virtualisation.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{ lib, config, ... }: {
- options = {
- virtualisation.enable = lib.mkEnableOption "enables virtualisation and virt-manager";
- };
-
- config = lib.mkIf config.virtualisation.enable {
- virtualisation.libvirtd.enable = true;
- programs.virt-manager.enable = config.software.desktop.enable;
- };
-}
diff --git a/modules/root/ssh.nix b/modules/root/ssh.nix
deleted file mode 100644
index 9f6d54d..0000000
--- a/modules/root/ssh.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- services.openssh = {
- enable = true;
- settings = {
- X11Forwarding = true;
- };
- };
-}
diff --git a/modules/root/tlp.nix b/modules/root/tlp.nix
deleted file mode 100644
index 3414c03..0000000
--- a/modules/root/tlp.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-{ lib, config, ... }: {
- options = {
- tlp.enable = lib.mkEnableOption "enables tlp";
- };
-
- config = lib.mkIf config.tlp.enable {
- services.tlp.enable = true;
- };
-}
diff --git a/modules/root/wifi.nix b/modules/root/wifi.nix
deleted file mode 100644
index 542cfd7..0000000
--- a/modules/root/wifi.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ lib, config, ... }: {
- options = {
- wifi.enable = lib.mkEnableOption "enables wifi";
- };
-
- config = lib.mkIf config.wifi.enable {
- networking.wireless = {
- enable = true; # Enables wireless support via wpa_supplicant.
- userControlled.enable = true;
- allowAuxiliaryImperativeNetworks = true; # Networks defined in aux imperitive networks (/etc/wpa_supplicant.conf)
- };
-
- # Link /etc/wpa_supplicant.conf -> secret config
- environment.etc."wpa_supplicant.conf" = {
- source = config.sops.secrets.wpa_supplicant-conf.path;
- };
- };
-}
diff --git a/modules/root/x11.nix b/modules/root/x11.nix
deleted file mode 100644
index fd15c52..0000000
--- a/modules/root/x11.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ pkgs, lib, config, ... }: {
- options = {
- xserver.enable = lib.mkEnableOption "enables xserver";
- };
-
- config = lib.mkIf config.xserver.enable {
- services.xserver.enable = true;
- services.xserver.displayManager.startx.enable = true;
- services.libinput.enable = true; # Enable touchpad support
-
- environment.systemPackages = with pkgs; [
- unclutter
- xcape
- xclip
- xdotool
- xorg.setxkbmap
- xorg.xinput
- xorg.xkill
- xorg.xrandr
- xorg.xset
- xwallpaper
- # Patch startx to be compliant with xdg base dir spec
- (xorg.xinit.overrideAttrs (old: rec {
- patches = [
- ./resources/x11/xinit-startx-xdg.patch
- ];
- }))
- ];
- };
-}
diff --git a/modules/root/zsh.nix b/modules/root/zsh.nix
deleted file mode 100644
index 697cb4c..0000000
--- a/modules/root/zsh.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{ lib, config, pkgs, ... }: {
- options = {
- zsh.enable = lib.mkEnableOption "use zsh as default shell";
- };
-
- config = lib.mkIf config.zsh.enable {
- programs.zsh.enable = true;
- users.defaultUserShell = pkgs.zsh;
- };
-}
diff --git a/nixos/bootloader.nix b/nixos/bootloader.nix
new file mode 100644
index 0000000..333f584
--- /dev/null
+++ b/nixos/bootloader.nix
@@ -0,0 +1,60 @@
+{ lib, config, ... }: let
+ cfg = config.boot._loader;
+in {
+ options.boot._loader = {
+ enable = lib.mkEnableOption "enable unified bootloader config";
+ loader = lib.mkOption {
+ type = lib.types.enum [ "grub" "systemd-boot" ];
+ default = "systemd-boot";
+ description = "whether to install grub or systemd-boot as the bootloader";
+ };
+ mode = lib.mkOption {
+ type = lib.types.enum [ "efi" "bios" ];
+ default = "efi";
+ description = "whether to install the bootloader in efi or bios mode";
+ };
+ grub = {
+ biosDevice = lib.mkOption {
+ type = lib.types.str;
+ description = "device to install grub on";
+ };
+ zfsSupport = lib.mkEnableOption "zfs boot device support";
+ };
+ memtest86.enable = lib.mkEnableOption "make Memtest86+ available from the bootloader";
+ };
+
+ config = let
+ usingEfi = cfg.mode == "efi";
+ usingBios = cfg.mode == "bios";
+ usingGrub = cfg.loader == "grub";
+ usingSystemdBoot = cfg.loader == "systemd-boot";
+ in lib.mkIf cfg.enable {
+ boot.loader = {
+ grub = lib.mkIf usingGrub {
+ enable = true;
+ # bios
+ device = lib.mkIf usingBios cfg.grub.biosDevice;
+ # efi
+ efiSupport = usingEfi;
+ efiInstallAsRemovable = usingEfi;
+ # zfs
+ zfsSupport = cfg.grub.zfsSupport;
+ mirroredBoots = lib.mkIf cfg.grub.zfsSupport [
+ { devices = [ "nodev" ]; path = "/boot"; }
+ ];
+ # misc
+ enableCryptodisk = true;
+ memtest86.enable = cfg.memtest86.enable;
+ };
+ systemd-boot = lib.mkIf usingSystemdBoot {
+ enable = true;
+ editor = false;
+ memtest86.enable = cfg.memtest86.enable;
+ };
+ efi = lib.mkIf usingEfi {
+ efiSysMountPoint = lib.mkIf usingGrub "/boot/efi";
+ canTouchEfiVariables = lib.mkIf usingSystemdBoot true;
+ };
+ };
+ };
+}
diff --git a/nixos/decklink.nix b/nixos/decklink.nix
new file mode 100644
index 0000000..d86fde3
--- /dev/null
+++ b/nixos/decklink.nix
@@ -0,0 +1,21 @@
+{ config, lib, pkgs, ... }: let
+ cfg = config.services._decklink;
+in {
+ options.services._decklink = {
+ enable = lib.mkEnableOption "enables decklink support";
+ decklinkSupport.enable = lib.mkEnableOption "enable decklinkSupport flag for all packages that support it by default";
+ };
+
+ config = lib.mkIf cfg.enable {
+ # Kernel modules
+ hardware.decklink.enable = true;
+
+ # DesktopVideoHelper
+ environment.systemPackages = [ pkgs.blackmagic-desktop-video ];
+
+ # Enable decklinkSupport flag globally for all packages that support it (e.g. obs)
+ nixpkgs.overlays = [
+ (final: prev: { decklinkSupport = cfg.decklinkSupport.enable; })
+ ];
+ };
+}
diff --git a/nixos/default.nix b/nixos/default.nix
new file mode 100644
index 0000000..ad91a03
--- /dev/null
+++ b/nixos/default.nix
@@ -0,0 +1,24 @@
+{
+ imports = [
+ ./programs/awesome.nix
+ ./programs/ddcutil.nix
+
+ ./services/fileshares.nix
+ ./services/mailer.nix
+ ./services/zfs/zed-mailer.nix
+ ./services/router
+
+ ./bootloader.nix
+ ./decklink.nix
+ ./geoclue.nix
+ ./hosts.nix
+ ./net-iface-labels.nix
+ ./nix.nix
+ ./polkit.nix
+ ./powerkeys.nix
+ ./secrets.nix
+ ./suspend.nix
+ ./wireless.nix
+ ./zshenv.nix
+ ];
+}
diff --git a/nixos/geoclue.nix b/nixos/geoclue.nix
new file mode 100644
index 0000000..344ef24
--- /dev/null
+++ b/nixos/geoclue.nix
@@ -0,0 +1,14 @@
+{ config, lib, ... }: let
+ cfg = config.services._geoclue2;
+in {
+ options.services._geoclue2 = {
+ enable = lib.mkEnableOption "enable geoclue2 service with minimal sources and set timezone automatically";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services.geoclue2 = {
+ enable = true;
+ };
+ services.automatic-timezoned.enable = lib.mkDefault true;
+ };
+}
diff --git a/nixos/hosts.nix b/nixos/hosts.nix
new file mode 100644
index 0000000..a87f3b4
--- /dev/null
+++ b/nixos/hosts.nix
@@ -0,0 +1,4 @@
+{ hostname, ... }: {
+ networking.hostName = hostname; # From flake.nix
+ environment.etc.hosts.mode = "0644"; # Allow temporary imperative modifications
+}
diff --git a/nixos/net-iface-labels.nix b/nixos/net-iface-labels.nix
new file mode 100644
index 0000000..b7ac655
--- /dev/null
+++ b/nixos/net-iface-labels.nix
@@ -0,0 +1,28 @@
+{ config, lib, ... }: let
+ cfg = config.networking._interfaceLabels;
+ validMac = str: builtins.match ''^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$'' str != null;
+ macAddressType = lib.types.str // {
+ check = validMac;
+ description = "a mac address (xx:xx:xx:xx:xx:xx)";
+ };
+in {
+ options.networking._interfaceLabels = {
+ enable = lib.mkEnableOption "manually label network interfaces";
+ interfaces = lib.mkOption {
+ type = lib.types.attrsOf macAddressType;
+ default = {};
+ example = {
+ "lan0" = "00:11:22:33:44:55";
+ "lan1" = "66:77:88:99:AA:BB";
+ };
+ description = "label network interfaces by their mac address";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ networking.usePredictableInterfaceNames = false;
+ services.udev.extraRules = lib.concatStringsSep "\n" (
+ lib.mapAttrsToList (name: mac: ''ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="${mac}", NAME="${name}"'') cfg.interfaces
+ );
+ };
+}
diff --git a/modules/root/nix.nix b/nixos/nix.nix
index ff8dd28..ff8dd28 100644
--- a/modules/root/nix.nix
+++ b/nixos/nix.nix
diff --git a/nixos/polkit.nix b/nixos/polkit.nix
new file mode 100644
index 0000000..d78130a
--- /dev/null
+++ b/nixos/polkit.nix
@@ -0,0 +1,48 @@
+{ lib, config, pkgs, ... }: let
+ cfg = config.security.polkit;
+
+ # This authentication agent will only autostart in a select few environments (e.g. GNOME, XFCE) by default.
+ # This derivation will allow the polkit_gnome agent to start in any environment so long as it is enabled.
+ polkit_gnome-autostart = pkgs.stdenv.mkDerivation {
+ name = "polkit_gnome-autostart";
+ priority = 5;
+
+ # Copy the autostart desktop entry and replace OnlyShowIn with NotShowIn to invert the selection.
+ # The default one will still select the same environments, but this new one will select the inverse,
+ # e.g. any environment that is not listed in the stock desktop entry.
+ buildCommand = ''
+ mkdir -p $out/etc/xdg/autostart
+ cp ${cfg._gnome.package}/etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop $out/etc/xdg/autostart/polkit-gnome-authentication-agent-1-de-agnostic.desktop
+ substituteInPlace $out/etc/xdg/autostart/polkit-gnome-authentication-agent-1-de-agnostic.desktop \
+ --replace-fail 'OnlyShowIn=' 'NotShowIn='
+ '';
+ };
+in {
+ options.security.polkit = {
+ _gnome = {
+ enable = lib.mkEnableOption "enables polkit_gnome authentication agent";
+ package = lib.mkPackageOption pkgs "polkit_gnome" { };
+ };
+ _allowUserPowerControls = lib.mkEnableOption "allow users to control the power state of the machine using poweroff/reboot commands";
+ _wheelNoPass = lib.mkEnableOption "allow users in wheel group to execute all commands without password";
+ };
+
+ config = lib.mkIf cfg.enable {
+ # Gnome
+ environment.systemPackages = lib.mkIf cfg._gnome.enable [ cfg._gnome.package polkit_gnome-autostart ];
+
+ # Optional rules
+ environment.etc = let
+ pkRulesD = "polkit-1/rules.d";
+ in {
+ "${pkRulesD}/10-reboot-poweroff-users.rules" = {
+ enable = cfg._allowUserPowerControls;
+ source = ./resources/polkit-1/rules.d/10-reboot-poweroff-users.rules;
+ };
+ "${pkRulesD}/0-wheel-no-pass.rules" = {
+ enable = cfg._wheelNoPass;
+ source = ./resources/polkit-1/rules.d/0-wheel-no-pass.rules;
+ };
+ };
+ };
+}
diff --git a/nixos/powerkeys.nix b/nixos/powerkeys.nix
new file mode 100644
index 0000000..040cfa8
--- /dev/null
+++ b/nixos/powerkeys.nix
@@ -0,0 +1,14 @@
+{ lib, config, ... }: let
+ cfg = config.services.logind._safePowerKey;
+in {
+ options.services.logind._safePowerKey = {
+ enable = lib.mkEnableOption "do not immediately shutdown when powerkey is pressed";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services.logind.settings.Login = {
+ HandlePowerKey = "ignore"; # Allow for powerkey to activate power script
+ HandlePowerKeyLongPress = "poweroff";
+ };
+ };
+}
diff --git a/nixos/programs/awesome.nix b/nixos/programs/awesome.nix
new file mode 100644
index 0000000..7c0b114
--- /dev/null
+++ b/nixos/programs/awesome.nix
@@ -0,0 +1,23 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config.services.xserver.windowManager._awesome;
+in {
+ options.services.xserver.windowManager._awesome = {
+ enable = lib.mkEnableOption "installs awesome window manager";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services.xserver.windowManager.awesome = {
+ # TODO use git version of awesome, maybe version on archlinux, notify when new version available
+ enable = true;
+ noArgb = true; # disables transparency. why not?
+ luaModules = with pkgs.luajitPackages; [
+ lgi
+ ];
+ package = with pkgs; awesome-git.override {
+ gtk3Support = true;
+ gtk3 = gtk3;
+ lua = luajit;
+ };
+ };
+ };
+}
diff --git a/nixos/programs/ddcutil.nix b/nixos/programs/ddcutil.nix
new file mode 100644
index 0000000..ef1801b
--- /dev/null
+++ b/nixos/programs/ddcutil.nix
@@ -0,0 +1,12 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config.programs._ddcutil;
+in {
+ options.programs._ddcutil = {
+ enable = lib.mkEnableOption "enables ddcutil and i2c control";
+ };
+
+ config = lib.mkIf cfg.enable {
+ hardware.i2c.enable = true;
+ environment.systemPackages = [ pkgs.ddcutil ];
+ };
+}
diff --git a/nixos/resources/polkit-1/rules.d/0-wheel-no-pass.rules b/nixos/resources/polkit-1/rules.d/0-wheel-no-pass.rules
new file mode 100644
index 0000000..93abf0d
--- /dev/null
+++ b/nixos/resources/polkit-1/rules.d/0-wheel-no-pass.rules
@@ -0,0 +1,5 @@
+polkit.addRule(function(action, subject) {
+ if (subject.isInGroup("wheel")) {
+ return polkit.Result.YES;
+ }
+});
diff --git a/nixos/resources/polkit-1/rules.d/10-reboot-poweroff-users.rules b/nixos/resources/polkit-1/rules.d/10-reboot-poweroff-users.rules
new file mode 100644
index 0000000..ed9dbf7
--- /dev/null
+++ b/nixos/resources/polkit-1/rules.d/10-reboot-poweroff-users.rules
@@ -0,0 +1,17 @@
+polkit.addRule(function (action, subject) {
+ if (
+ subject.isInGroup("users") &&
+ [
+ "org.freedesktop.login1.reboot",
+ "org.freedesktop.login1.reboot-multiple-sessions",
+ "org.freedesktop.login1.power-off",
+ "org.freedesktop.login1.power-off-multiple-sessions",
+ "org.freedesktop.login1.suspend",
+ "org.freedesktop.login1.suspend-multiple-sessions",
+ "org.freedesktop.login1.hibernate",
+ "org.freedesktop.login1.hibernate-multiple-sessions",
+ ].indexOf(action.id) !== -1
+ ) {
+ return polkit.Result.YES;
+ }
+});
diff --git a/modules/root/secrets.nix b/nixos/secrets.nix
index 47262fd..3d21e62 100644
--- a/modules/root/secrets.nix
+++ b/nixos/secrets.nix
@@ -1,25 +1,17 @@
-{ pkgs, inputs, config, userDetails, ... }: {
- imports = [ inputs.sops-nix.nixosModules.sops ];
+{ inputs, config, pkgs, ... }: {
+ environment.systemPackages = with pkgs; [ age sops ];
sops = {
- defaultSopsFile = ./resources/secrets/secrets.yaml;
defaultSopsFormat = "yaml";
- age.keyFile = "${userDetails.home.root}/.config/sops/age/keys.txt";
-
- secrets = {
- wpa_supplicant-conf = { };
- hashed-root-password = { };
- };
+ age.sshKeyPaths = [ "/root/.ssh/id_ed25519" ];
};
+
# This service is a workaround to ensure that secrets are available on
# reboot when the secret keys are on a separate subvolume
systemd.services.npcnix-force-rebuild-sops-hack = {
wantedBy = [ "multi-user.target" ];
- before = [
- # List all services that require secrets
- "wpa_supplicant.service"
- ];
+ before = [ "wpa_supplicant.service" ];
serviceConfig = {
ExecStart = "/run/current-system/activate";
Type = "oneshot";
diff --git a/nixos/services/fileshares.nix b/nixos/services/fileshares.nix
new file mode 100644
index 0000000..e8981c4
--- /dev/null
+++ b/nixos/services/fileshares.nix
@@ -0,0 +1,296 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config.services._fileShares;
+
+ fileShareType = lib.types.submodule ({ name, ... }: {
+ options = {
+ enable = lib.mkEnableOption "enable this file share"; # FIXME mk default
+ name = lib.mkOption {
+ type = lib.types.str;
+ default = name;
+ description = "name of share";
+ };
+ path = lib.mkOption {
+ type = lib.types.str;
+ default = name;
+ description = "path to share";
+ };
+ readOnly = lib.mkEnableOption "make share read only";
+ allowHosts = lib.mkOption {
+ type = lib.types.listOf lib.types.str;
+ default = [];
+ example = [ "192.168.1.100" "192.168.0.0/24" ];
+ description = "ip hosts to allow";
+ };
+ # TODO denyHosts etc
+ nfs = {
+ enable = lib.mkEnableOption "share file with nfs protocol";
+ };
+ smb = {
+ enable = lib.mkEnableOption "share file with smb protocol";
+ allowGuests = lib.mkEnableOption "allow unauthenticated users to mount";
+ allowUser = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ default = null;
+ description = "allow user";
+ };
+ allowGroup = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ default = null;
+ description = "allow group";
+ };
+ defaultFileMask = lib.mkOption {
+ type = lib.types.strMatching "[0-7]{3,4}";
+ default = "0644";
+ description = "default permissions for created files";
+ };
+ defaultDirectoryMask = lib.mkOption {
+ type = lib.types.strMatching "[0-7]{3,4}";
+ default = "0755";
+ description = "default permissions for created directories";
+ };
+ extraOptions = lib.mkOption {
+ type = lib.types.attrsOf lib.types.str;
+ default = {};
+ description = "extra smb options for this share";
+ };
+ };
+ };
+ });
+
+ sambaEnrollUserType = lib.types.submodule ({ name, config, ... }: {
+ options = {
+ enable = lib.mkEnableOption "enroll this user";
+ name = lib.mkOption {
+ type = lib.types.str;
+ default = name;
+ description = "unix username of user to enroll";
+ };
+ password = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ default = null;
+ description = "initial plaintext password to set, visible in nix store";
+ };
+ passwordFile = lib.mkOption {
+ type = lib.types.nullOr lib.types.path;
+ default = null;
+ description = "file containing the initial plaintest password";
+ };
+ hashedPasswordFile = lib.mkOption {
+ type = lib.types.nullOr lib.types.path;
+ default = null;
+ description = "path to a file containing the NT hash of the initial password";
+ };
+ mustChangePassword = lib.mkEnableOption "force user to set new password on first logon";
+ disabled = lib.mkEnableOption "disable user";
+ script = lib.mkOption {
+ type = lib.types.str;
+ readOnly = true;
+ internal = true;
+ visible = false;
+ };
+ };
+ config = {
+ script = let
+ name = lib.escapeShellArg config.name;
+ pw =
+ if config.hashedPasswordFile != null then "$(cat ${toString config.hashedPasswordFile})"
+ else if config.passwordFile != null then "$(cat ${toString config.passwordFile})"
+ else if config.password != null then "${config.password}"
+ else ""
+ ;
+ in ''
+ if ! ${pkgs.samba}/bin/pdbedit -L 2>/dev/null | cut -d: -f1 | grep -qx ${name} > /dev/null; then
+ echo "samba: enrolling ${name}"
+ pw="${lib.escapeShellArg pw}"
+ # set password to contents of pw
+ printf '%s\n%s\n' "$pw" "$pw" | ${pkgs.samba}/bin/smbpasswd -s -a ${name} >/dev/null
+ # set password hash directly if hashedPasswordFile is used
+ ${lib.optionalString (config.hashedPasswordFile != null) ''
+ ${pkgs.samba}/bin/pdbedit -u ${name} --set-nt-hash="$pw" > /dev/null
+ ''}
+ # set must change password
+ ${lib.optionalString config.mustChangePassword ''
+ ${pkgs.samba}/bin/pdbedit -u ${name} --pwd-must-change-time=0 > /dev/null
+ ''}
+ fi
+ # enable / disable user
+ ${pkgs.samba}/bin/smbpasswd ${if config.disabled then "-d" else "-e"} ${name} >/dev/null
+ '';
+ };
+ });
+
+ # Shares
+ sambaShares = lib.filterAttrs (_: s: s.smb.enable) cfg.shares;
+ nfsShares = lib.filterAttrs (_: s: s.nfs.enable) cfg.shares;
+
+ # SMB
+ sambaGlobalSettings.global = let
+ hostname = config.networking.hostName;
+ in {
+ "workgroup" = lib.mkDefault "WORKGROUP";
+ "server string" = lib.mkDefault hostname;
+ "netbios name" = lib.mkDefault hostname;
+ "security" = lib.mkDefault "user";
+ #"use sendfile" = "yes";
+ #"max protocol" = "smb2";
+ "hosts allow" = lib.mkDefault "192.168.1. 127.0.0.1 localhost"; # TODO does this work?
+ "hosts deny" = lib.mkDefault "0.0.0.0/0";
+ "guest account" = lib.mkDefault "nobody";
+ "map to guest" = lib.mkDefault "bad user";
+ "smb ports" = cfg.smb.port;
+ };
+ sambaLegacyNT1Settings.global = {
+ "server min protocol" = "NT1";
+ "server max protocol" = "NT1";
+ "ntlm auth" = lib.boolToYesNo true;
+ "lanman auth" = lib.boolToYesNo true;
+ "client lanman auth" = lib.boolToYesNo true;
+ };
+ sambaUnixPasswordSyncSettings.global = {
+ "unix password sync" = lib.boolToYesNo true;
+ "pam password change" = lib.boolToYesNo true;
+ "passwd program" = "/run/wrappers/bin/passwd %u";
+ "passwd chat" = "*New*password* %n\\n *Retype*new*password* %n\\n *updated*successfully*";
+ };
+ mkSambaShare = s: {
+ "path" = s.path;
+ "browsable" = lib.boolToYesNo true;
+ "read only" = lib.boolToYesNo s.readOnly;
+ "guest ok" = lib.boolToYesNo s.smb.allowGuests;
+ "create mask" = s.smb.defaultFileMask;
+ "directory mask" = s.smb.defaultDirectoryMask;
+ # allow user/group
+ "force user" = lib.mkIf (s.smb.allowUser != null) s.smb.allowUser;
+ "force group" = lib.mkIf (s.smb.allowGroup != null) s.smb.allowGroup;
+ # allow hosts
+ "hosts deny" = lib.mkIf (s.allowHosts != []) "ALL";
+ "hosts allow" = lib.mkIf (s.allowHosts != []) (lib.concatStringsSep " " s.allowHosts);
+ } // s.smb.extraOptions;
+ sambaSettings = sambaGlobalSettings
+ // lib.optionalAttrs cfg.smb.enableLegacyNT1 sambaLegacyNT1Settings
+ // lib.optionalAttrs cfg.smb.enableUnixPasswordSync sambaUnixPasswordSyncSettings
+ // lib.mapAttrs (_: v: mkSambaShare v) sambaShares
+ ;
+
+ # NFS
+ mkNFSShareHost = s: host: ''${host}(${if s.readOnly then "ro" else "rw"},sync,no_subtree_check)''; # TODO configure
+ mkNFSShare = s: ''
+ ${s.path} ${lib.concatMapStringsSep " " (mkNFSShareHost s) (if s.allowHosts == [] then ["*"] else s.allowHosts) }
+ '';
+ nfsExports = lib.concatMapAttrsStringSep "\n" (_: v: mkNFSShare v) nfsShares;
+in {
+ options.services._fileShares = {
+ enable = lib.mkEnableOption "protocol agnostic fileshares module";
+ shares = lib.mkOption {
+ type = lib.types.attrsOf fileShareType;
+ default = {};
+ description = "nfs/smb fileshares";
+ };
+ smb = {
+ openFirewall = lib.mkEnableOption "open firewall for smb";
+ port = lib.mkOption {
+ type = lib.types.int;
+ default = 445;
+ };
+ enableLegacyNT1 = lib.mkEnableOption ''
+ enable legacy smb1/nt1 protocol support with ntlm/lanman auth.
+ required for very old clients (windows xp, legacy nas devices, etc).
+ '';
+ enableNetBiosDiscovery = lib.mkEnableOption "enable netbios name resolution for clients";
+ enableUnixPasswordSync = lib.mkEnableOption ''
+ enable syncing unix passwords to smb database whenever password is set
+ with `passwd`. may still need to run `sudo smbpasswd -a $USER` (or set
+ new password via `passwd`) if enabled after password was already set.
+ '';
+ enrollUsers = lib.mkOption {
+ type = lib.types.attrsOf sambaEnrollUserType;
+ default = {};
+ description = "users to enroll declaratively for their initial setup";
+ };
+ };
+ nfs = {
+ enableNFSv3 = lib.mkEnableOption "enable support for nfsv3";
+ openFirewall = lib.mkEnableOption "open firewall for nfs(v4/v3)";
+ };
+ };
+
+ config = lib.mkIf cfg.enable (lib.mkMerge [
+ # SMB config
+ (lib.mkIf (sambaShares != []) {
+ services.samba = {
+ enable = true;
+ openFirewall = lib.mkDefault cfg.smb.openFirewall;
+ nmbd.enable = cfg.smb.enableNetBiosDiscovery;
+ settings = sambaSettings;
+ };
+ })
+
+ # SMB enroll users config
+ (let
+ enrollUsers = lib.filterAttrs (_: u: u.enable) cfg.smb.enrollUsers;
+ pwSources = u: lib.filter (x: x != null) [ u.password u.passwordFile u.hashedPasswordFile ];
+ in lib.mkIf (sambaShares != [] && enrollUsers != []) {
+ assertions = lib.mapAttrsToList (n: u: {
+ assertion = builtins.length (pwSources u) == 1;
+ message = ''
+ services._fileShares.smb.enrollUsers.${n}: set exactly one of
+ password, passwordFile, or hashedPasswordFile
+ (found ${toString (builtins.length (pwSources u))})
+ '';
+ }) enrollUsers;
+
+ warnings = lib.mapAttrsToList (n: u: ''
+ services._fileShares.smb.enrollUsers.${n}.password is stored in
+ plaintext in the world-readable Nix store; use passwordFile instead
+ '') (lib.filterAttrs (_: u: u.password != null) enrollUsers);
+
+ # Enroll users activation script
+ system.activationScripts.sambaEnrollUsers = lib.stringAfter [ "users" "setupSecrets" ] ''
+ set -eu
+ ${lib.concatMapAttrsStringSep "\n" (_: u: u.script) enrollUsers}
+ '';
+ })
+
+ # NFS(v4/v3) config
+ (lib.mkIf (nfsShares != []) {
+ services.nfs.server = lib.mkMerge [
+ # Base config
+ {
+ enable = true;
+ exports = nfsExports;
+ }
+
+ # NFSv3 additional config
+ (lib.mkIf cfg.nfs.enableNFSv3 {
+ # fixed rpc.statd port; for firewall
+ lockdPort = 4001;
+ mountdPort = 4002;
+ statdPort = 4000;
+ extraNfsdConfig = '''';
+ })
+ ];
+ })
+
+ # Firewall
+ ({
+ networking.firewall = lib.mkMerge [
+ # SMB
+ (lib.mkIf cfg.smb.openFirewall {
+ allowedTCPPorts = [ cfg.smb.port ]
+ ++ lib.optional cfg.smb.enableNetBiosDiscovery 139;
+ allowedUDPPorts = lib.optionals cfg.smb.enableNetBiosDiscovery [ 137 138 ];
+ })
+
+ # NFS
+ (lib.mkIf cfg.nfs.openFirewall (
+ if cfg.nfs.enableNFSv3 then {
+ allowedTCPPorts = [ 111 2049 4000 4001 4002 20048 ];
+ allowedUDPPorts = [ 111 2049 4000 4001 4002 20048 ];
+ } else {
+ allowedTCPPorts = [ 2049 ];
+ }
+ ))
+ ];
+ })
+ ]);
+}
diff --git a/nixos/services/mailer.nix b/nixos/services/mailer.nix
new file mode 100644
index 0000000..fadaaf1
--- /dev/null
+++ b/nixos/services/mailer.nix
@@ -0,0 +1,67 @@
+{ lib, pkgs, config, ... }: let
+ cfg = config.services.mail._mailer;
+in {
+ options.services.mail._mailer = {
+ enable = lib.mkEnableOption "enable msmtp mailer service";
+ sender = {
+ host = lib.mkOption {
+ type = lib.types.str;
+ description = "";
+ example = "smtp.mail.example.com";
+ };
+ user = lib.mkOption {
+ type = lib.types.str;
+ description = "";
+ example = "myname@example.com";
+ };
+ from = lib.mkOption {
+ type = lib.types.str;
+ description = "";
+ example = "myname@example.com";
+ };
+ passwordFile = lib.mkOption {
+ type = lib.types.path;
+ description = "";
+ };
+ };
+ recipient = lib.mkOption {
+ type = lib.types.str;
+ description = "";
+ example = "admin@example.com";
+ };
+ };
+
+ # https://wiki.nixos.org/wiki/ZFS#Mail_notifications_(ZFS_Event_Daemon)
+ config = lib.mkIf cfg.enable {
+ # MTA
+ programs.msmtp = {
+ enable = true;
+ setSendmail = true;
+ defaults = {
+ aliases = "/etc/aliases";
+ port = 587;
+ auth = "plain";
+ tls = "on";
+ tls_starttls = "on";
+ };
+ accounts = {
+ default = with cfg.sender; {
+ inherit host user from;
+ passwordeval = "cat ${passwordFile}";
+ };
+ };
+ };
+
+ # Configure an alias for root account.
+ # With this alias configured, all mails sent to root, such as cron job
+ # results and failed sudo login events, will be redirected to the
+ # configured email account.
+ environment.etc.aliases.text = ''
+ root: ${cfg.recipient}
+ '';
+
+ # For zed enableMail, enable sendmailSetuidWrapper
+ services.mail.sendmailSetuidWrapper.enable = true;
+ };
+}
+
diff --git a/nixos/services/router/default.nix b/nixos/services/router/default.nix
new file mode 100644
index 0000000..4e59752
--- /dev/null
+++ b/nixos/services/router/default.nix
@@ -0,0 +1,8 @@
+{
+ imports = [
+ ./dns-dhcp.nix
+ ./hairpinning.nix
+ ./routing.nix
+ ./unbound-blocklist.nix
+ ];
+}
diff --git a/nixos/services/router/dns-dhcp.nix b/nixos/services/router/dns-dhcp.nix
new file mode 100644
index 0000000..edc9895
--- /dev/null
+++ b/nixos/services/router/dns-dhcp.nix
@@ -0,0 +1,306 @@
+{ config, lib, ... }: let
+ cfg = config.services._router.dnsDhcpConfig;
+ staticLeaseType = lib.types.submodule (
+ { name, ... }: {
+ options = {
+ enable = lib.mkEnableOption "enable this static lease";
+ macAddress = lib.mkOption {
+ type = lib.types.str;
+ default = "";
+ example = "00:11:22:33:44:55";
+ };
+ hostname = lib.mkOption {
+ type = lib.types.str;
+ default = name;
+ };
+ staticIp = lib.mkOption {
+ type = lib.types.str;
+ default = "";
+ example = "192.168.1.2";
+ };
+ };
+
+ config.enable = lib.mkDefault true;
+ }
+ );
+in {
+ options.services._router.dnsDhcpConfig = {
+ enable = lib.mkEnableOption "enable pre-configured unbound(outbound) + dnsmasq(local) dns(+dhcp) server";
+ #enableUnbound = lib.mkEnableOption "enable unbound as outbound dns server";
+ dns = {
+ overrides = {
+ zones = lib.mkOption {
+ type = lib.types.attrsOf (lib.types.enum [ "transparent" "typetransparent" "static" "redirect" ]);
+ default = {};
+ description = "local zones and how names without local data are handled";
+ };
+ records = lib.mkOption {
+ type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: {
+ options = {
+ name = lib.mkOption {
+ type = lib.types.str;
+ default = name;
+ description = "record name. defaults to the attribute key";
+ };
+ recordType = lib.mkOption {
+ type = lib.types.enum [ "A" "AAAA" "CNAME" "TXT" "MX" "SRV" "CAA" "NS" "PTR" ];
+ };
+ value = lib.mkOption {
+ type = lib.types.str;
+ };
+ };
+ }));
+ default = {};
+ example = ''{
+ "files.example.com" = { recordType = "A"; value = "192.168.1.20"; };
+ "git.example.com" = { recordType = "CNAME"; value = "files.example.com"; };
+ # Same name, second record: use a different key and set name explicitly
+ "files.example.com-v6" = {
+ name = "files.example.com";
+ recordType = "AAAA";
+ value = "fd00::20";
+ };
+ }'';
+ description = "dns override records";
+ };
+ };
+ };
+ dhcp = {
+ enable = lib.mkEnableOption "enable dnsmasq dns server" // { default = true; };
+ defaultGateway = lib.mkOption {
+ type = lib.types.str;
+ default = "192.168.1.1";
+ };
+ localhostIp = lib.mkOption {
+ type = lib.types.str;
+ default = "192.168.1.1";
+ description = "ip of the dns+dhcp host";
+ };
+ rangeStart = lib.mkOption {
+ type = lib.types.str;
+ default = "192.168.1.100";
+ description = "dhcp range start";
+ };
+ rangeEnd = lib.mkOption {
+ type = lib.types.str;
+ default = "192.168.1.250";
+ description = "dhcp range end";
+ };
+ rangeSubnetMask = lib.mkOption {
+ type = lib.types.str;
+ default = "255.255.255.0";
+ description = "dhcp range subnet";
+ };
+ leaseTime = lib.mkOption {
+ type = lib.types.str;
+ default = "12h";
+ description = "how long a dhcp lease will last. suffix is one of [h,m,s]";
+ };
+ staticLeases = lib.mkOption {
+ type = lib.types.attrsOf staticLeaseType;
+ default = {};
+ example = {
+ hostname0 = {
+ macAddress = "00:11:22:33:44:55";
+ staticIp = "192.168.1.6";
+ };
+ hostname1 = {
+ macAddress = "66:77:88:99:AA:BB";
+ staticIp = "192.168.1.7";
+ };
+ };
+ description = "dhcp static leases";
+ };
+ };
+ localResolution = {
+ localDomain = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ #default = if cfg.dhcp.enable then "home.lan" else null;
+ default = "home.lan";
+ description = "domain name for local dns queries, resolved by local dns service";
+ };
+ localDnsAddress = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ #default = if cfg.localResolution.localDomain != null then "127.0.0.1@5353" else null;
+ default = "127.0.0.1@5353";
+ description = "dns server used to resolve queries to the local network e.g. dhcp attached devices";
+ };
+ localReverseZone = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ #default = if cfg.localResolution.localDomain != null then "1.168.192.in-addr.arpa" else null;
+ default = "1.168.192.in-addr.arpa";
+ description = "dns zone to resolve local ptr (reverse dns) requests. e.g. 192.168.1.0/24 -> 1.168.192";
+ };
+ localReverseDnsAddress = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ default = cfg.localResolution.localDnsAddress;
+ description = "dns server used to resolve local ptr (reverse dns) queries";
+ };
+ localDomainOverrides = lib.mkOption {
+ type = lib.types.attrsOf lib.types.str;
+ default = {};
+ example = {
+ "poweredge.home.lan" = "192.168.1.10";
+ "router.home.lan" = "192.168.1.1";
+ "example.com" = "192.168.1.100";
+ };
+ description = "dns overrides for specific hosts on the local domain";
+ };
+ };
+ #ipv6 = lib.mkEnableOption "enable ipv6"; # TODO
+ };
+
+ config = lib.mkIf cfg.enable {
+ # Unbound as a recursive DNS resolver.
+ # Preferred for its security/privacy features + performance
+ services.unbound = {
+ enable = true;
+ settings = {
+ server = let
+ fqdn = n: if lib.hasSuffix "." n then n else "${n}.";
+
+ # Apply fqdn to the last field of a multi-field value (MX, SRV)
+ fqdnLast = v: let
+ parts = lib.splitString " " v;
+ in lib.concatStringsSep " " (lib.init parts ++ [ (fqdn (lib.last parts)) ]);
+
+ formatValue = r: {
+ CNAME = fqdn r.value;
+ NS = fqdn r.value;
+ PTR = fqdn r.value;
+ MX = fqdnLast r.value;
+ SRV = fqdnLast r.value;
+ TXT = ''"${r.value}"'';
+ }.${r.recordType} or r.value;
+ in {
+ # Listen on all interfaces (or specify specific IPs)
+ interface = [ "0.0.0.0" ]; # ++ lib.optionals cfg.ipv6 [ "::0" ];
+
+ # Allow queries from local networks
+ access-control = [
+ "127.0.0.0/8 allow"
+ "192.168.0.0/16 allow"
+ "10.0.0.0/8 allow"
+ "172.16.0.0/12 allow"
+ ];
+
+ # Cache settings
+ cache-min-ttl = 300; # 5 min
+ cache-max-ttl = 60 * 60 * 24; # 1 day
+
+ # Prefetch DNS records for better performance
+ prefetch-key = true;
+ prefetch = true;
+
+ # Enable DNSSEC validation (signed DNS, prevents man-in-the-middle attacks)
+ # `auto-trust-anchor-file` is set by default to "/var/unbound/root.key"
+ trust-anchor-file = ''""'';
+ domain-insecure = cfg.localResolution.localDomain; # Local domain is not DNSSEC-signed
+ harden-below-nxdomain = true; # Protect against non-existent domain response attacks
+ harden-glue = true; # Protect against incorrect DNS glue record attacks
+ harden-dnssec-stripped = true; # Ensures that DNSSEC signatures are not stripped from DNS responses
+
+ # Allow queries to localhost for dnsmasq local domain resolution
+ do-not-query-localhost = false;
+
+ # Privacy / Security
+ harden-referral-path = true; # Prevents receiving data from servers that are outside the zone in the DNS referral chain
+ qname-minimisation = true; # Minimizes the amount of information exposed in DNS queries by only sending the essential parts of the query
+ hide-identity = true; # Hide software identity in response
+ hide-version = true; # Hide unbound version in response
+ use-caps-for-id = false; # Disables using uppercase characters in the DNS transaction ID, for compatibility
+ edns-buffer-size = 1232; # Sets the EDNS (Extension mechanisms for DNS) buffer size to 1232 bytes, which is the default for many DNS resolvers
+
+ # Overrides
+ local-zone = lib.mapAttrsToList (zone: type: ''"${fqdn zone}" ${type}'') cfg.dns.overrides.zones;
+ local-data = map (r: "'${fqdn r.name} IN ${r.recordType} ${formatValue r}'") (lib.attrValues cfg.dns.overrides.records);
+
+ # Logging
+ #verbosity = 3;
+ #log-queries = true;
+ #log-replies = true;
+ #log-local-actions = true;
+ };
+ # Forward unknown to public resolver via DoT
+ forward-zone = [
+ # Local DNS: forward to dnsmasq
+ (lib.mkIf (cfg.localResolution.localDomain != null && cfg.localResolution.localDnsAddress != null) {
+ name = ''"${cfg.localResolution.localDomain}."''; # TODO mk config
+ forward-addr = cfg.localResolution.localDnsAddress; # TODO mk config
+ })
+ # Local reverse DNS: forward reverse lookups (PTR records)
+ (lib.mkIf (cfg.localResolution.localReverseZone != null && cfg.localResolution.localReverseDnsAddress != null) {
+ name = ''"${cfg.localResolution.localReverseZone}"'';
+ forward-addr = cfg.localResolution.localReverseDnsAddress;
+ })
+ # Upstream DNS
+ {
+ name = ''"."'';
+ forward-addr = [
+ "9.9.9.9#dns.quad9.net"
+ "149.112.112.112#dns.quad9.net"
+ ];
+ forward-tls-upstream = true; # Encrypted DNS
+ }
+ ];
+ remote-control.control-enable = true;
+ };
+ };
+
+ # Configure dnsmasq for dhcp and local hostname resolution
+ services.dnsmasq = {
+ enable = cfg.dhcp.enable;
+ settings = let
+ mkDNSHostOverride = host: ip: "${host},${ip}";
+ dnsHostOverrides = lib.mapAttrsToList (host: ip: mkDNSHostOverride host ip) cfg.localResolution.localDomainOverrides;
+ mkDHCPRange = ipRangeStart: ipRangeEnd: subnetMask: leaseTime: "${ipRangeStart},${ipRangeEnd},${subnetMask},${leaseTime}";
+ mkDHCPOption = option: value: "option:${option},${value}";
+ mkDHCPStaticLease = macAddress: hostname: staticIp: "${macAddress},${hostname},${staticIp},infinite";
+ dhcpStaticLeases = lib.mapAttrsToList (_: l: mkDHCPStaticLease l.macAddress l.hostname l.staticIp) cfg.dhcp.staticLeases;
+ in {
+ # General
+ no-resolv = true; # Do not read /etc/resolv.conf, resolve only the LAN
+ no-poll = true; # Do not poll /etc/resolv.conf for changes
+ # TODO config local domain
+ local = "/${cfg.localResolution.localDomain}/"; # Use local-only for the defined domain (prevents upstream leaks)
+ domain = cfg.localResolution.localDomain; # Define the local domain name
+ expand-hosts = true; # Create both fully-qualified and short-name entries from DHCP hostnames
+
+ # DNS Server
+ port = 5353; # Use port 5353 for DNS server since unbound is the main DNS resolver
+
+ host-record = dnsHostOverrides; # Setup host overrides for dns
+
+ # DHCP Server
+ # TODO config
+ #dhcp-range = mkDHCPRange "192.168.1.50" "192.168.1.150" "255.255.255.0" "12h"; # Enable DHCP on the LAN interface
+ dhcp-range = with cfg.dhcp; mkDHCPRange rangeStart rangeEnd rangeSubnetMask leaseTime; # Enable DHCP on the LAN interface
+
+ dhcp-host = dhcpStaticLeases; # Setup static leases
+
+ dhcp-option = with cfg.dhcp; [
+ (mkDHCPOption "router" defaultGateway) # Set default gateway for clients
+ #(mkDHCPOption "ntp-server" defaultGateway) # Set ntp server for clients
+ (mkDHCPOption "dns-server" localhostIp) # Set dns server for clients
+ (mkDHCPOption "domain-search" cfg.localResolution.localDomain) # Add search rule to clients so they can resolve hostnames w/o the local domain suffix
+ ];
+
+ #dhcp-no-override = true; # don't use kernel DHCP helpers that bypass macvlan
+
+ # Logging
+ #log-dhcp = true; # Log DHCP events
+ #log-queries = true; # Log DNS queries
+
+ # Cache
+ cache-size = 1000; # Small cache limit is fine since Unbound does the heavy caching
+ };
+ };
+
+ # Search localDomain so host can resolve short names
+ # This is eq. to dnsmasq's dhcp-option "domain-search" for clients, it just adds a search rule to resolv.conf
+ networking.search = [ cfg.localResolution.localDomain ];
+
+ # Add localhost as default nameserver
+ networking.nameservers = lib.mkDefault [ cfg.dhcp.localhostIp ];
+ };
+}
diff --git a/nixos/services/router/hairpinning.nix b/nixos/services/router/hairpinning.nix
new file mode 100644
index 0000000..e449525
--- /dev/null
+++ b/nixos/services/router/hairpinning.nix
@@ -0,0 +1,47 @@
+{ config, lib, ... }: let
+ cfg = config.networking.nat._hairpinning;
+
+ forwardPorts = config.networking.nat.forwardPorts;
+ internalInterfaces = config.networking.nat.internalInterfaces;
+
+ # DNAT
+ mkIfacesMap = ifs: lib.concatMapStringsSep ", " (i: ''"${i}"'') ifs;
+ mkDnatRule = ifs: proto: sourcePort: destination: ''
+ iifname { ${mkIfacesMap ifs} } ${proto} dport ${toString sourcePort} dnat to ${destination}
+ '';
+ dnatRules = lib.concatMapStrings (p: mkDnatRule internalInterfaces p.proto p.sourcePort p.destination) forwardPorts;
+
+ # SNAT
+ mkSnatTargets = proto: destIp: destPort: ''
+ ip daddr ${destIp} ${proto} dport ${destPort} masquerade
+ '';
+ snatTargets = lib.concatMapStrings(p: let
+ d = lib.splitString ":" p.destination;
+ destIp = builtins.elemAt d 0;
+ destPort = builtins.elemAt d 1;
+ in mkSnatTargets p.proto destIp destPort) forwardPorts;
+in {
+ options.networking.nat._hairpinning = {
+ enable = lib.mkEnableOption "enable nat hairpinning (loopback) to allow internal interfaces to reach forwarded services via the external ip";
+ };
+ config = lib.mkIf (config.networking.nat.enable && cfg.enable) {
+ warnings = [
+ (lib.mkIf (forwardPorts == [])
+ "nat hairpinning enabled but no forwardPorts have been configured. skipping configuration.")
+ ];
+
+ networking.nftables.tables."hairpin" = lib.mkIf (forwardPorts != []) {
+ family = "ip";
+ content = ''
+ chain pre {
+ type nat hook prerouting priority dstnat; policy accept;
+ ${dnatRules}
+ }
+ chain post {
+ type nat hook postrouting priority srcnat; policy accept;
+ ${snatTargets}
+ }
+ '';
+ };
+ };
+}
diff --git a/nixos/services/router/routing.nix b/nixos/services/router/routing.nix
new file mode 100644
index 0000000..c86301f
--- /dev/null
+++ b/nixos/services/router/routing.nix
@@ -0,0 +1,39 @@
+{ config, lib, ... }: let
+ cfg = config.services._router.routing;
+in {
+ options.services._router.routing = {
+ enable = lib.mkEnableOption "enable nftables routing";
+ interfaces = {
+ wan = lib.mkOption {
+ type = lib.types.str;
+ default = "";
+ description = "wan interface";
+ };
+ lan = lib.mkOption {
+ type = lib.types.listOf lib.types.str;
+ default = "";
+ description = "lan interfaces";
+ };
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ # https://hackers-arise.com/linux-basics-for-hackers-building-a-router-with-nftables/
+ networking = {
+ nftables.enable = true;
+ firewall = {
+ enable = true;
+ backend = "nftables"; # Set explicitly
+
+ # Allow lan interfaces to access the router
+ trustedInterfaces = cfg.interfaces.lan;
+ };
+ nat = {
+ enable = lib.mkDefault true;
+ externalInterface = lib.mkDefault cfg.interfaces.wan;
+ internalInterfaces = lib.mkDefault cfg.interfaces.lan;
+ _hairpinning.enable = lib.mkDefault (config.networking.nat.forwardPorts != []);
+ };
+ };
+ };
+}
diff --git a/nixos/services/router/unbound-blocklist.nix b/nixos/services/router/unbound-blocklist.nix
new file mode 100644
index 0000000..27f2a04
--- /dev/null
+++ b/nixos/services/router/unbound-blocklist.nix
@@ -0,0 +1,82 @@
+{ lib, config, pkgs, ... }: let
+ cfg = config.services.unbound._blocklists;
+ hageziList = list: [
+ "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/rpz/${list}.txt"
+ "https://gitlab.com/hagezi/mirror/-/raw/main/dns-blocklists/rpz/${list}.txt"
+ "https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/rpz/${list}.txt"
+ ];
+ hageziBlocklists = lib.listToAttrs (
+ map (n: { name = "hagezi_${n}"; value = n; }) cfg.hageziBlocklists
+ );
+ blocklists = hageziBlocklists // cfg.extraBlocklists;
+in {
+ options.services.unbound._blocklists = {
+ enable = lib.mkEnableOption "enable rpz blocklist generation in unbound";
+ hageziBlocklists = lib.mkOption {
+ type = lib.types.listOf lib.types.str;
+ description = "hagezi blocklists to enable";
+ example = [ "pro" "nsfw" ];
+ };
+ extraBlocklists = lib.mkOption {
+ type = lib.types.attrsOf (lib.types.listOf lib.types.str);
+ example = {
+ hageziNSFW = [
+ "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/rpz/nsfw.txt"
+ "https://gitlab.com/hagezi/mirror/-/raw/main/dns-blocklists/rpz/nsfw.txt"
+ "https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/rpz/nsfw.txt"
+ ];
+ hageziPro = [
+ "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/rpz/pro.txt"
+ "https://gitlab.com/hagezi/mirror/-/raw/main/dns-blocklists/rpz/pro.txt"
+ "https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/rpz/pro.txt"
+ ];
+ };
+ default = {};
+ description = "blocklist urls in response policy zone (rpz) format";
+ };
+ # TODO
+ #extraBlacklistedDomains = lib.mkOption {
+ # type = lib.types.listOf lib.types.str;
+ # example = [
+ # "example.com"
+ # "*.example.com"
+ # "elpmaxe.com"
+ # "*.elpmaxe.com"
+ # ];
+ # default = [];
+ # description = "additional domains to block";
+ #};
+ #extraWhitelistedDomains = lib.mkOption {
+ # type = lib.types.listOf lib.types.str;
+ # example = [
+ # "example.com"
+ # "*.example.com"
+ # "elpmaxe.com"
+ # "*.elpmaxe.com"
+ # ];
+ # default = [];
+ # description = "whitelist domains that would otherwise be blocked";
+ #};
+ };
+
+ config = lib.mkIf (cfg.enable && config.services.unbound.enable) {
+ # Configure rpz + blocklists in unbound
+ services.unbound.settings = let
+ # https://unbound.docs.nlnetlabs.nl/en/latest/topics/filtering/rpz.html
+ rpzEntry = name: url: { inherit name url; rpz-action-override = "nxdomain"; }; # TODO extra attrs option instead of adding rpz-action-override by default
+ ## Generate extraBlockedDomains
+ #extraBlockedDomainsRPZ = lib.strings.concatStringsSep "\n" (builtins.map (domain: "${domain} CNAME ."));
+ #extraBlockedDomainsRPZFile = pkgs.writeText "extraBlockedDomains" ''
+ # $TTL 300
+ # @ SOA localhost. root.localhost. 1 43200 3600 86400 300
+ # NS localhost.
+ # ${extraBlockedDomainsRPZ}
+ #'';
+ #extraBlockedDomainsRPZEntries = rpzEntry "extraBlockedDomains" extraBlockedDomainsRPZFile;
+ rpz = lib.mapAttrsToList rpzEntry blocklists;
+ in {
+ server.module-config = ''"respip validator iterator"''; # Adds respip before validator and iterator. Needed for rpz config
+ inherit rpz;
+ };
+ };
+}
diff --git a/nixos/services/zfs/zed-mailer.nix b/nixos/services/zfs/zed-mailer.nix
new file mode 100644
index 0000000..06acd1f
--- /dev/null
+++ b/nixos/services/zfs/zed-mailer.nix
@@ -0,0 +1,20 @@
+{ lib, pkgs, config, ... }: let
+ cfg = config.services.zfs._zedMailer;
+in {
+ options.services.zfs._zedMailer = {
+ enable = lib.mkEnableOption "enable zed mailer service";
+ };
+
+ # https://wiki.nixos.org/wiki/ZFS#Mail_notifications_(ZFS_Event_Daemon)
+ config = lib.mkIf cfg.enable {
+ services.zfs.zed = {
+ enableMail = true;
+ settings = {
+ ZED_EMAIL_ADDR = [ "root" ];
+ # send notification if scrub succeeds
+ ZED_NOTIFY_VERBOSE = true;
+ };
+ };
+ };
+}
+
diff --git a/nixos/suspend.nix b/nixos/suspend.nix
new file mode 100644
index 0000000..0e719ab
--- /dev/null
+++ b/nixos/suspend.nix
@@ -0,0 +1,21 @@
+{ lib, config, ... }: let
+ cfg = config.systemd._suspend;
+in {
+ options.systemd._suspend = {
+ disable = lib.mkEnableOption "disables suspend";
+ };
+
+ config = lib.mkIf cfg.disable {
+ # Disable suspend targets
+ systemd.targets = builtins.listToAttrs (map (name: {
+ inherit name;
+ value = {
+ enable = false;
+ unitConfig.DefaultDependencies = "no";
+ };
+ }) ["sleep" "suspend" "hibernate" "hybrid-sleep"]);
+
+ # Hibernate key => suspend
+ services.logind.settings.Login.HandleHibernateKey = "suspend";
+ };
+}
diff --git a/nixos/wireless.nix b/nixos/wireless.nix
new file mode 100644
index 0000000..22c759f
--- /dev/null
+++ b/nixos/wireless.nix
@@ -0,0 +1,22 @@
+{ config, lib, ... }: let
+ cfg = config.networking.wireless;
+ mkCredential = cred: file: "${cred}:${file}";
+ mkCredentialPath = cred: _: "/run/credentials/wpa_supplicant.service/${cred}";
+in {
+ options.networking.wireless = {
+ _extraSecretConfigs = lib.mkOption {
+ type = lib.types.attrsOf lib.types.str;
+ description = "extra config files loaded into systemd credentials";
+ default = {};
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ systemd.services.wpa_supplicant.serviceConfig = {
+ LoadCredential = lib.mapAttrsToList mkCredential cfg._extraSecretConfigs;
+ };
+ networking.wireless = {
+ extraConfigFiles = lib.mapAttrsToList mkCredentialPath cfg._extraSecretConfigs;
+ };
+ };
+}
diff --git a/nixos/zshenv.nix b/nixos/zshenv.nix
new file mode 100644
index 0000000..4c2fc7c
--- /dev/null
+++ b/nixos/zshenv.nix
@@ -0,0 +1,24 @@
+{ lib, config, ... }: let
+ cfg = config.programs.zsh._zshenv;
+ generatedExports = lib.concatLines (
+ lib.mapAttrsToList (var: value: ''export ${var}="${value}"'') cfg.exports
+ );
+in {
+ options.programs.zsh._zshenv = {
+ enable = lib.mkEnableOption "generate /etc/zshenv.local";
+ exports = lib.mkOption {
+ type = lib.types.attrsOf lib.types.str;
+ default = {};
+ example = {
+ ZDOTDIR = "$HOME/.config/zsh";
+ };
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.etc."zshenv.local".text = ''
+ # Exports
+ ${generatedExports}
+ '';
+ };
+}
diff --git a/pkgs/crazydiskinfo/default.nix b/pkgs/crazydiskinfo/default.nix
new file mode 100644
index 0000000..61de338
--- /dev/null
+++ b/pkgs/crazydiskinfo/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, cmake
+, fetchFromGitHub
+, fetchpatch
+, libatasmart
+, ncurses5
+, stdenv
+}:
+
+stdenv.mkDerivation rec {
+ pname = "crazydiskinfo";
+ version = "1.1.0";
+
+ src = fetchFromGitHub {
+ owner = "otakuto";
+ repo = pname;
+ rev = "refs/tags/${version}";
+ sha256 = "sha256-+6ShoaggQ256sLSJDj4d16OipUYX/4JjEwLL5hswjiQ=";
+ };
+
+ patches = [
+ # Patch to fix build warnings
+ (fetchpatch {
+ url = "https://github.com/otakuto/crazydiskinfo/compare/1.1.0...8563aa8.diff";
+ sha256 = "sha256-z9aOQFsivu6sYgsZBOlnTvqnoR2ro/jyuO/WOimLSXk=";
+ })
+ ];
+
+ nativeBuildInputs = [ cmake ];
+ buildInputs = [ libatasmart ncurses5 ];
+
+ cmakeFlags = [ "-DCMAKE_INSTALL_PREFIX=$(out)" ];
+
+ meta = with lib; {
+ description = "CrazyDiskInfo is an interactive TUI S.M.A.R.T viewer for Unix systems";
+ homepage = "https://github.com/otakuto/crazydiskinfo";
+ mainProgram = "crazy";
+ license = licenses.mit;
+ maintainers = [ maintainers.tjkeller ];
+ };
+}
diff --git a/pkgs/default.nix b/pkgs/default.nix
new file mode 100644
index 0000000..c1e2206
--- /dev/null
+++ b/pkgs/default.nix
@@ -0,0 +1,57 @@
+{ pkgs, inputs, ... }: {
+ nixpkgs.overlays = with pkgs; [
+ (final: prev: {
+ immich-frame = (callPackage ./immich-frame {});
+ lowbat = (callPackage ./lowbat {});
+ workcentre-7800-series = (callPackage ./xerox-workcentre-7800-series-driver {});
+ unclutter-desktop-entry = (callPackage ./unclutter-desktop-entry {});
+
+ # Update awesome
+ awesome-git = prev.awesome.overrideAttrs (oldAttrs: {
+ pname = "awesome-git";
+ version = "git-20260828-0a5e50c";
+ src = fetchFromGitHub {
+ owner = "awesomeWM";
+ repo = "awesome";
+ rev = "0a5e50cf7ee214fae47159e0e976ab4a78d2ed4f";
+ sha256 = "sha256-GUX1jHdLpEe9hfABBVgaoHc+l83/uZ+IP+3zdHb/U7E=";
+ };
+ patches = [];
+ postPatch = ''
+ patchShebangs tests/examples/_postprocess.lua
+ '';
+ env.FONTCONFIG_FILE = pkgs.makeFontsConf { fontDirectories = [ ]; };
+ });
+
+ # Use my vimv-rs until pr gets merged
+ vimv-rs = prev.vimv-rs.overrideAttrs (oldAttrs: {
+ src = fetchFromGitHub {
+ owner = "tjkeller-xyz";
+ repo = "vimv-rs";
+ rev = "5deb76fb81dd4acf3c4809087ff3a1d846ab4769";
+ sha256 = "sha256-XMn+5mIxSEHaR31ixMi6o7PSkN1iYjDT4aOiQkfEwpA=";
+ };
+ });
+
+ # Use my tamzen until pr gets merged
+ tamzen = prev.tamzen.overrideAttrs (oldAttrs: {
+ src = fetchFromGitHub {
+ owner = "tjkeller-xyz";
+ repo = "tamzen-font";
+ rev = "middledot";
+ sha256 = "sha256-mVZ8SdYKTdMG1qBKKYdNjuoYvWkEq2ph2O1ztsNJEhs=";
+ };
+ });
+ })
+ # Import overlays
+ (import ./st/overrides.nix)
+ (import ./vimPlugins/overrides.nix)
+ (import ./xorg/overrides.nix)
+ # Allow installing unstable packages via pkgs.unstable.<name>
+ (final: prev: {
+ unstable = import inputs.nixpkgs-unstable {
+ inherit (final) system;
+ };
+ })
+ ];
+}
diff --git a/pkgs/immich-frame/default.nix b/pkgs/immich-frame/default.nix
new file mode 100644
index 0000000..9c2c0f0
--- /dev/null
+++ b/pkgs/immich-frame/default.nix
@@ -0,0 +1,46 @@
+{
+ fetchgit,
+ pkgs,
+ python3Packages,
+ buildNpmPackage,
+}:
+let
+ version = "0.4.1";
+ src = fetchgit {
+ url = "https://git.tjkeller.xyz/immich-frame";
+ tag = "v${version}";
+ hash = "sha256-1E//uhk/egkt5y1XMn52EHumdgswxq45bwntNIoCeRM=";
+ };
+
+ frontend = buildNpmPackage {
+ inherit version src;
+ pname = "immich-frame-frontend";
+
+ npmWorkspace = "src/client";
+ npmDepsHash = "sha256-/8dHzpqvnDZb+SV9O/GvTyspKLaPDs4vt3QrzoLsyEI=";
+
+ installPhase = ''
+ mkdir -p $out
+ cp -R dist $out/
+ '';
+ };
+in python3Packages.buildPythonApplication {
+ inherit version src;
+ pname = "immich-frame";
+
+ makeWrapperArgs = [ "--set" "IMMICH_FRAME_STATIC_WEB_ASSETS" "${frontend}/dist" ];
+
+ pyproject = true;
+ build-system = with python3Packages; [ setuptools ];
+ propagatedBuildInputs = with python3Packages; [
+ flask
+ flask-cors # DEBUG
+ flask-socketio
+ numpy
+ pillow
+ platformdirs
+ pygame
+ pyopengl
+ requests
+ ];
+}
diff --git a/pkgs/lowbat/default.nix b/pkgs/lowbat/default.nix
new file mode 100644
index 0000000..64ec205
--- /dev/null
+++ b/pkgs/lowbat/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, fetchzip
+, glib
+, libnotify
+, pkg-config
+, stdenv
+}:
+
+stdenv.mkDerivation rec {
+ pname = "lowbat";
+ version = "1.2.2";
+
+ src = fetchzip {
+ url = "https://git.tjkeller.xyz/${pname}/snapshot/${pname}-${version}.tar.xz";
+ sha256 = "sha256-utdcY9qoDcrBWnGC8m/LUsnoxQ0ilssPDF44A6D/C+8=";
+ };
+
+ nativeBuildInputs = [ pkg-config ];
+ buildInputs = [ libnotify glib ];
+
+ installFlags = [ "PREFIX=$(out)" ];
+
+ meta = with lib; {
+ description = "A minimal battery level monitor daemon, written in C";
+ license = licenses.mit;
+ maintainers = [ maintainers.tjkeller ];
+ };
+}
diff --git a/pkgs/st/overrides.nix b/pkgs/st/overrides.nix
new file mode 100644
index 0000000..744cbf8
--- /dev/null
+++ b/pkgs/st/overrides.nix
@@ -0,0 +1,19 @@
+final: prev: {
+ st = prev.st.overrideAttrs (finalAttrs: previousAttrs: {
+ version = "tj-0.9.3.1";
+
+ src = prev.fetchgit {
+ url = "https://git.tjkeller.xyz/${previousAttrs.pname}";
+ tag = finalAttrs.version;
+ sha256 = "sha256-MYVGoGQsUMiIzvCXTjpYLv9sRpcoaO9wZ65fTGaY0Vw=";
+ };
+
+ makeFlags = previousAttrs.makeFlags ++ [ "CFLAGS=-Ofast" ];
+ buildInputs = with prev.pkgs; previousAttrs.buildInputs ++ [ libxcursor libxext ];
+
+ meta = with prev.lib; previousAttrs.meta // {
+ homepage = "https://git.tjkeller.xyz/st";
+ maintainers = previousAttrs.meta.maintainers ++ [ maintainers.tjkeller ];
+ };
+ });
+}
diff --git a/pkgs/unclutter-desktop-entry/default.nix b/pkgs/unclutter-desktop-entry/default.nix
new file mode 100644
index 0000000..c98cbda
--- /dev/null
+++ b/pkgs/unclutter-desktop-entry/default.nix
@@ -0,0 +1,14 @@
+{ pkgs }:
+
+pkgs.makeDesktopItem {
+ name = "unclutter";
+ desktopName = "Unclutter";
+ comment = "Hides mouse pointer while not in use";
+ exec = "${pkgs.unclutter-xfixes}/bin/unclutter";
+ icon = "input-mouse";
+ categories = [ "Utility" ];
+ keywords = [ "mouse" "cursor" "hide" "idle" "pointer" ];
+ #extraConfig = ''
+ # NoDisplay=true
+ #'';
+}
diff --git a/pkgs/vimPlugins/overrides.nix b/pkgs/vimPlugins/overrides.nix
new file mode 100644
index 0000000..2b8bd33
--- /dev/null
+++ b/pkgs/vimPlugins/overrides.nix
@@ -0,0 +1,83 @@
+final: prev: {
+ vimPlugins = prev.vimPlugins // {
+ minitab-nvim = prev.vimUtils.buildVimPlugin rec {
+ pname = "minitab.nvim";
+ version = "2024-11-28";
+ rev = "f6183e8cb6f408e54dd5d1d13c0075376655a3ec";
+ src = prev.fetchzip {
+ url = "https://git.tjkeller.xyz/${pname}/snapshot/${pname}-${rev}.tar.xz";
+ sha256 = "sha256-INJC+6GNTF5MpvtOh6/eYD5CMiXxlP6aHT5TX2lJqiM=";
+ };
+ meta.homepage = "https://git.tjkeller.xyz/minitab.nvim";
+ };
+
+ lazy-like-loader-nvim = prev.vimUtils.buildVimPlugin rec {
+ pname = "lazy-like-loader.nvim";
+ version = "2026-07-31";
+ rev = "56b1314c4470f35ee4511fa29f8e137636accb1a";
+ src = prev.fetchzip {
+ url = "https://git.tjkeller.xyz/${pname}/snapshot/${pname}-${rev}.tar.xz";
+ sha256 = "sha256-ijsxiyvanuHttF+FfWnac6bJ7HVfqcaYcDq+zALVY9g=";
+ };
+ meta.homepage = "https://git.tjkeller.xyz/lazy-like-loader.nvim";
+ };
+
+ tree-sitter-jinja2 = prev.vimUtils.buildVimPlugin rec {
+ pname = "tree-sitter-jinja2";
+ version = "2026-07-17";
+ src = prev.fetchFromGitHub {
+ owner = "geigerzaehler";
+ repo = "tree-sitter-jinja2";
+ rev = "7af726f7ac42db3fe798d45ee375078bbef28a41";
+ sha256 = "sha256-6lw38wvrQP/c3z7m40ygXNij60Gh2owx+Ibvfzwa47s=";
+ };
+ nativeBuildInputs = [ prev.tree-sitter ];
+ buildPhase = ''
+ # Provide tree-sitter with a place it can write to
+ mkdir -p $TMPDIR/.cache/tree-sitter
+ export XDG_CACHE_HOME=$TMPDIR/.cache
+ # Copy build instructions from repo
+ tree-sitter build --output parser/jinja2.so
+ '';
+ meta.homepage = "https://github.com/geigerzaehler/tree-sitter-jinja2";
+ };
+
+ rainbow-delimiters-nvim = prev.vimPlugins.rainbow-delimiters-nvim.overrideAttrs (finalAttrs: previousAttrs: {
+ patches = [
+ # Add support for htmljinja
+ (prev.fetchpatch {
+ url = "https://github.com/HiPhish/rainbow-delimiters.nvim/pull/194.diff";
+ sha256 = "sha256-5wbA0WE60nJ5B745kPilsxRPPN1I0qGf/qd/A79RCfw=";
+ })
+ ];
+ });
+
+ # TODO replace plugin for simple grammar
+ #nvim-treesitter-parsers = prev.vimPlugins.nvim-treesitter-parsers // {
+ # jinja2 = prev.tree-sitter.buildGrammar rec {
+ # language = "jinja2";
+ # version = "2026-07-17";
+ # src = prev.fetchFromGitHub {
+ # owner = "geigerzaehler";
+ # repo = "tree-sitter-jinja2";
+ # rev = "7af726f7ac42db3fe798d45ee375078bbef28a41";
+ # sha256 = "sha256-6lw38wvrQP/c3z7m40ygXNij60Gh2owx+Ibvfzwa47s=";
+ # };
+ # nativeBuildInputs = [ prev.tree-sitter prev.jq ];
+ # buildPhase = ''
+ # mkdir -p $TMPDIR/.cache/tree-sitter
+ # export XDG_CACHE_HOME=$TMPDIR/.cache
+ # tree-sitter build --output parser/jinja2.so
+ # # FIXME the parser needs to be built with tree_sitter_htmljinja as the
+ # #grammar name instead of jinja2.
+ # # The plugin registers htmljinja to use the jinja2 parser within nvim.
+ # # But if you want this to be a "dumb" solution without any lua commands
+ # # to register the language then it needs to be built with the correct
+ # # symbol.
+ # #ln -s jinja2.so parsers/htmljinja.so
+ # '';
+ # meta.homepage = "https://github.com/geigerzaehler/tree-sitter-jinja2";
+ # };
+ #};
+ };
+}
diff --git a/pkgs/xerox-workcentre-7800-series-driver/default.nix b/pkgs/xerox-workcentre-7800-series-driver/default.nix
new file mode 100644
index 0000000..cfdaaae
--- /dev/null
+++ b/pkgs/xerox-workcentre-7800-series-driver/default.nix
@@ -0,0 +1,86 @@
+{
+ stdenv,
+ lib,
+ fetchurl,
+ dpkg,
+ autoPatchelfHook,
+ cups,
+ xorg,
+}:
+let
+ debPlatform =
+ if stdenv.hostPlatform.system == "x86_64-linux" then
+ "x86_64"
+ else if stdenv.hostPlatform.system == "i686-linux" then
+ "i686"
+ else
+ throw "Unsupported system: ${stdenv.hostPlatform.system}";
+in
+stdenv.mkDerivation rec {
+ pname = "xerox-workcentre-7800-series-driver";
+ version = "5.20.661.4684";
+ debpkg = "XeroxOfficev5Pkg-Linux${debPlatform}-${version}.deb";
+
+ src = fetchurl {
+ url = "https://download.support.xerox.com/pub/drivers/CQ8580/drivers/linux/pt_BR/${debpkg}";
+ sha256 = "014k0r9ij3401mnab1qzv96bjl9x7rf11aw1ibf0q370pk9jqqjb"; # TODO correct hash for i686
+ };
+
+ nativeBuildInputs = [ dpkg autoPatchelfHook ];
+ # TODO add support for disable xorg
+ buildInputs = [
+ cups
+ stdenv.cc.cc.lib
+ xorg.libX11
+ xorg.libXrender
+ xorg.libXfixes
+ xorg.libXdamage
+ xorg.libXcomposite
+ xorg.libXcursor
+ xorg.libXrandr
+ xorg.libXext
+ xorg.libXinerama
+ ];
+
+ sourceRoot = ".";
+ unpackCmd = "dpkg-deb -x $curSrc .";
+
+ dontConfigure = true;
+ dontBuild = true;
+
+ installPhase = ''
+ runHook preInstall
+
+ mkdir -p $out
+
+ # Copy and patch the binaries and libraries
+ cp -r opt $out/
+ cp -r usr $out/
+
+ # Move the PPD to CUPS model dir
+ mkdir -p $out/share/cups/model
+ cp opt/XeroxOffice/prtsys/ppd/*.ppd $out/share/cups/model/
+
+ # Install the CUPS filters
+ mkdir -p $out/lib/cups/filter
+ cp usr/lib/cups/filter/* $out/lib/cups/filter/
+
+ # Install man pages
+ mkdir -p $out/share/man
+ cp -r usr/share/man/* $out/share/man/
+
+ runHook postInstall
+ '';
+
+ meta = with lib; {
+ description = "Xerox WorkCentre 7800 Series Linux Printer Driver";
+ longDescription = ''
+ WorkCentre 7830/7835/7845/7855
+ '';
+ homepage = "https://www.support.xerox.com/en-us/product/workcentre-7800-series/downloads?platform=linux";
+ sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+ #license = licenses.unfree;
+ maintainers = [];
+ platforms = platforms.linux;
+ };
+}
diff --git a/pkgs/xorg/overrides.nix b/pkgs/xorg/overrides.nix
new file mode 100644
index 0000000..0cd9490
--- /dev/null
+++ b/pkgs/xorg/overrides.nix
@@ -0,0 +1,18 @@
+final: prev: {
+ # Apply startx patch to create serverauth file in /tmp instead of home directory
+ xinit = prev.xinit.overrideAttrs (finalAttrs: previousAttrs: {
+ version = "1.4.4";
+ patchtag = "${finalAttrs.version}-1"; # Archlinux xinit package tagged release to fetch patch from
+ # Override src since is hardcoded to 1.4.2
+ src = prev.fetchurl {
+ url = "mirror://xorg/individual/app/xinit-${finalAttrs.version}.tar.xz";
+ sha256 = "sha256-QKR8ehZMf5gc43h7Szf35BH7QyMdzeVD1wCUB12s/vk=";
+ };
+ patches = [
+ (prev.fetchpatch {
+ url = "https://gitlab.archlinux.org/archlinux/packaging/packages/xorg-xinit/-/raw/${finalAttrs.patchtag}/06_move_serverauthfile_into_tmp.diff";
+ sha256 = "1whzs5bw7ph12r3abs1g9fydibkr291jh56a0zp17d4x070jnkda";
+ })
+ ];
+ });
+}
diff --git a/poweredge-pro outline b/poweredge-pro outline
new file mode 100644
index 0000000..bdb7fb8
--- /dev/null
+++ b/poweredge-pro outline
@@ -0,0 +1,58 @@
+poweredge-pro
+
+https://wiki.nixos.org/wiki/ZFS
+
+SERVICES:
+- nfs/smb file shares
+- cronjobs / systemd units
+ - zfs scrubbing
+ - zfs snapshotting
+- services.smartd
+- ups safe power down
+- allow backup to truenas
+- virtual machines
+ - virtual router opnsense
+- unbound + dnsmasq
+ - local hostname resolving e.g. ping poweredge-pro
+ - overrides and blocklists (manual black/whitelist)
+- router profile
+- web services
+ - admin streamline (docker for now)
+ - chexx-internal-webservices (docker)
+ - chexx-webservices (docker)
+ - filebrowser (potential container to avoid break out)
+ - gitea (container with ssh & git)
+ - mailcow (docker)
+- tjkeller web services
+ - cgit (public git) (container with ssh & git)
+ - searxng
+ - minitube
+ - smtm
+
+SECURITY
+- boot security
+ - boots without password
+ - certain services start without password
+ - chexx-webservices
+ - all tjkeller services
+ - others require password to be entered for encryption (all not mentioned above)
+- file security
+ - encrypted zfs pools
+
+DISKS
+- boot + services disk
+ - zfs
+ - encryption
+ - datasets
+ - /var/lib/machines
+ - /var/lib/docker
+
+
+IPS
+- streamline: 10.0.0.2 : 5021
+- chexx-internal-webservices: 10.0.0.2 : 8080
+- chexx-webservices: 10.0.0.2 : 8081
+- filebrowser: 10.0.1.2
+- gitea: 10.0.1.3
+- mailcow: 10.0.0.2 : 21 445 etc
+- tj cgit: 10.0.1.4
diff --git a/rebuild b/rebuild
new file mode 100755
index 0000000..a9b63e3
--- /dev/null
+++ b/rebuild
@@ -0,0 +1,10 @@
+#!/bin/sh
+if [ ! -f ~/.config/sops/age/keys.txt ]; then
+ mkdir -p ~/.config/sops/age
+ echo "---------------------------------------------------------------------------------------------------"
+ echo "| WARNING: Sops key not found. Please generate one from your ssh key using the following command: |"
+ echo "| nix run nixpkgs#ssh-to-age -- -private-key -i ~/.ssh/private > ~/.config/sops/age/keys.txt |"
+ echo "| cat ~/.config/sops/age/keys.txt | age-keygen -y # Public key |"
+ echo "---------------------------------------------------------------------------------------------------"
+fi
+nixos-rebuild switch --sudo --flake "$(dirname "$0")/#$(hostname)" $@
diff --git a/todo b/todo
index b3fc58b..2378d09 100644
--- a/todo
+++ b/todo
@@ -1,18 +1,29 @@
# Misc / low priority
fix screen turning off when playing video for extended period
-sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
- ^- systemctl restart systemd-logind.service
-
-ff violentmonkey userscripts
+ff violentmonkey userscripts import
pcmanfm config FIX
-fonts.fontconfig.antialias = false && gtk font override on librex60
libreoffice calibre dark+svg icon theme and dark mode
-# Secrets
+thunderbird config
+
fix firefox no show http/s and no hist
-clone repos activation script fix when cloning from ssh
-thunderbird (https://home-manager-options.extranix.com/?query=thunderbird&release=release-24.05)
# Not needed
install zsh as root
+
+#
+git-sync
+geoclue cache location
+geoclue continuously try to get location if not available
+get rid of launch script, move x config to new repo, retire dotconfig repo
+font improvements hinting etc home manager
+
+#
+zsh support
+zsh plugins installed via nix pkg manager instead of zplug
+headless virtual machines / view display with vnc in browser
+support office xerox printer properly
+
+#
+create mountpoints for nas
diff --git a/users/default-home.nix b/users/default-home.nix
new file mode 100644
index 0000000..d0cc18b
--- /dev/null
+++ b/users/default-home.nix
@@ -0,0 +1,5 @@
+{
+ imports = [
+ ./timmy/home.nix
+ ]
+}
diff --git a/users/default.nix b/users/default.nix
new file mode 100644
index 0000000..8eb5373
--- /dev/null
+++ b/users/default.nix
@@ -0,0 +1,5 @@
+{
+ imports = [
+ ./timmy
+ ];
+}
diff --git a/users/timmy/default.nix b/users/timmy/default.nix
new file mode 100644
index 0000000..4f9e206
--- /dev/null
+++ b/users/timmy/default.nix
@@ -0,0 +1,87 @@
+{ lib, config, pkgs, home-manager, ... }: let
+ cfg = config._users.timmy;
+ username = "timmy";
+ fullname = "Tim Keller";
+ home = "/home/${username}";
+ sshKeyPaths = [ "${home}/.ssh/id_ed25519" ];
+ #sshPublicKeyPaths = lib.map (keyPath: keyPath + ".pub") sshKeyPaths;
+ sshPublicKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDnsnAWcz46OVi1MWSxpOIUtUvwalijDwvW+oEvNjzep" ];
+in {
+ options._users.${username} = {
+ enable = lib.mkEnableOption "create user ${username}";
+ autologin.enable = lib.mkEnableOption "enables getty automatic login";
+ };
+
+ # FIXME
+ imports = [
+ ./hosts.nix
+ ./localization.nix
+ ./nas.nix
+ ./printing.nix
+ ./repos.nix
+ ./user.nix
+ ./wifi.nix
+ ];
+
+ config = lib.mkIf cfg.enable {
+ # Setup zsh
+ programs.zsh = {
+ enable = true;
+ _zshenv = {
+ enable = true;
+ exports = {
+ ZDOTDIR = "$HOME/.config/zsh";
+ };
+ };
+ };
+ #environment.systemPackages = [ pkgs.zsh-fast-syntax-highlighting ]; # TODO
+
+ # Setup normal user
+ users.users.${username} = {
+ inherit home;
+ description = fullname;
+ isNormalUser = true;
+ uid = 1000;
+ shell = pkgs.zsh;
+ extraGroups = [
+ "nixbld"
+ "video"
+ "wheel"
+ ] ++ lib.optionals config.hardware.i2c.enable [
+ "i2c"
+ ] ++ lib.optionals config.virtualisation.libvirtd.enable [
+ "libvirtd"
+ ] ++ lib.optionals config.virtualisation.docker.enable [
+ "docker"
+ ];
+ };
+
+ # Enable sudo, doas, polkit nopass
+ security.sudo = {
+ enable = true;
+ wheelNeedsPassword = false;
+ };
+ security.doas = {
+ enable = true;
+ wheelNeedsPassword = false;
+ extraRules = [{ keepEnv = true; }];
+ };
+ security.polkit = {
+ _wheelNoPass = true;
+ };
+
+ # Configure automatic login with getty
+ services.getty = lib.mkIf cfg.autologin.enable {
+ autologinUser = username;
+ };
+
+ # Configure sops age key paths since age keys are generated via ssh private key
+ sops.age = { inherit sshKeyPaths; };
+
+ # Configure user home
+ home-manager.users.${username} = {
+ imports = [ ./home.nix ];
+ _users.${username}.home.enable = lib.mkDefault true;
+ };
+ };
+}
diff --git a/users/timmy/home.nix b/users/timmy/home.nix
new file mode 100644
index 0000000..4124832
--- /dev/null
+++ b/users/timmy/home.nix
@@ -0,0 +1,109 @@
+{ lib, pkgs, config, ... }: let
+ cfg = config._users.${username}.home;
+ username = "timmy";
+ email = "tjk@tjkeller.xyz";
+ fullname = "Tim Keller";
+ home = "/home/${username}";
+ userDirs = {
+ download = "${home}/dls";
+ documents = "${home}/docs";
+ pictures = "${home}/pics";
+ projects = "${home}/docs/src";
+ # Set these as null so they're not created
+ desktop = null;
+ music = null;
+ publicShare = null;
+ templates = null;
+ videos = null;
+ };
+in {
+ options._users.${username}.home = {
+ enable = lib.mkEnableOption "configure home for user ${username}";
+ #neovim = {
+ # enableLSP = lib.mkEnableOption "whether to enable lsp";
+ #};
+ };
+
+ config = lib.mkIf cfg.enable {
+ # Setup home-manager
+ home = {
+ username = username;
+ homeDirectory = home;
+ stateVersion = "26.05";
+ };
+
+ # Setup userdirs
+ xdg.userDirs = {
+ enable = true;
+ createDirectories = true;
+ } // userDirs;
+
+ # Setup git
+ programs.git = {
+ enable = true;
+ settings = {
+ user = {
+ name = fullname;
+ email = email;
+ };
+ merge.tool = "nvimdiff";
+ mergetool.nvimdiff = {
+ cmd = ''nvim -d "$LOCAL" "$MERGED" "$REMOTE"'';
+ prompt = false;
+ };
+ # Unfortunately, this doesn't work for some reason
+ #url = {
+ # "ssh://git@publicgit/".insteadOf = "https://git.tjkeller.xyz/";
+ #};
+ };
+ };
+
+ # Setup gtk bookmarks
+ gtk.gtk3.bookmarks = let
+ mkBookmark = name: dir: ''file://${dir} ${lib.toUpper (lib.substring 0 1 name)}${lib.substring 1 (-1) name}''; # Make first letter upper case
+ attrsToBookmarks = attrs: lib.mapAttrsToList (name: dir: lib.mkIf (dir != null) (mkBookmark name dir)) attrs;
+ bookmarksUserDirs = attrsToBookmarks userDirs;
+ in bookmarksUserDirs;
+
+ # Setup neovim
+ programs.neovim-vanilla = {
+ enable = true;
+ viAlias = true;
+ vimAlias = true;
+ plugins = {
+ lsp = {
+ enable = lib.mkDefault true;
+ lspconfig.enable = true;
+ languageServers.packages = with pkgs; [
+ python313Packages.python-lsp-server
+ svelte-language-server
+ tailwindcss-language-server
+ typescript-language-server
+ vscode-langservers-extracted
+ ];
+ };
+ treesitter = {
+ enable = lib.mkDefault true;
+ parsers.installAll = lib.mkDefault true;
+ };
+ packages.start = with pkgs.vimPlugins; [
+ autoclose-nvim
+ blink-cmp
+ gruvbox-nvim
+ lazy-like-loader-nvim
+ mini-align
+ minitab-nvim
+ nvim-colorizer-lua
+ nvim-ts-autotag # depends on treesitter
+ rainbow-delimiters-nvim # depends on treesitter
+ snacks-nvim
+ tree-sitter-jinja2
+ ];
+ };
+ extraPackages = with pkgs; [
+ gcc # Treesitter requires a C compiler
+ unzip # For zip, xlsx, etc. files
+ ];
+ };
+ };
+}
diff --git a/users/timmy/hosts.nix b/users/timmy/hosts.nix
new file mode 100644
index 0000000..1d9a0cc
--- /dev/null
+++ b/users/timmy/hosts.nix
@@ -0,0 +1,8 @@
+{
+ networking.hosts = {
+ "192.168.77.88" = [ "publicgit" "cgit" ];
+ "192.168.77.3" = [ "devel" ];
+ "192.168.1.10" = [ "poweredge" ];
+ "192.168.77.11" = [ "poweredge-pro" ];
+ };
+}
diff --git a/users/timmy/localization.nix b/users/timmy/localization.nix
new file mode 100644
index 0000000..bcbb422
--- /dev/null
+++ b/users/timmy/localization.nix
@@ -0,0 +1,14 @@
+{ lib, config, ... }: {
+ time.timeZone = lib.mkDefault "America/Chicago"; # Overwritten by automatic-timezoned
+ i18n.defaultLocale = "en_US.UTF-8";
+ services.xserver.xkb.layout = "us";
+
+ # Setup static geoclue2 if wifi is disabled
+ services.geoclue2 = {
+ enableStatic = lib.mkDefault (!config._users.timmy.wifi.enable);
+ staticLatitude = 41.881832;
+ staticLongitude = -87.623177;
+ staticAltitude = 600;
+ staticAccuracy = 500;
+ };
+}
diff --git a/users/timmy/nas.nix b/users/timmy/nas.nix
new file mode 100644
index 0000000..eff6a94
--- /dev/null
+++ b/users/timmy/nas.nix
@@ -0,0 +1,36 @@
+{ lib, config, ... } :
+let
+ cfg = config._users.timmy.nas;
+ mkNetworkFileSystem = device: automount: {
+ device = "${device}";
+ fsType = "nfs";
+ options = [ "defaults" ] ++ lib.optionals (!automount) [ "noauto" ];
+ };
+in {
+ options._users.timmy.nas = {
+ enable = lib.mkEnableOption "enable network shares";
+ home = {
+ enable = lib.mkEnableOption "enable home network shares";
+ automount = lib.mkEnableOption "automount home network shares";
+ };
+ office = {
+ enable = lib.mkEnableOption "enable office network shares";
+ automount = lib.mkEnableOption "automount home network shares";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ # TODO clean this up
+ fileSystems = lib.optionalAttrs cfg.home.enable {
+ "/media/ingens/backups" = mkNetworkFileSystem "poweredge:/media/ingens/backups" cfg.home.automount;
+ "/media/ingens/tapes" = mkNetworkFileSystem "poweredge:/media/ingens/tapes" cfg.home.automount;
+ "/media/ingens/pictures" = mkNetworkFileSystem "poweredge:/media/ingens/pictures" cfg.home.automount;
+ "/media/ingens/media" = mkNetworkFileSystem "poweredge:/media/ingens/media" cfg.home.automount;
+ } // lib.optionalAttrs cfg.office.enable {
+ "/media/chexx/chexx" = mkNetworkFileSystem "poweredge-pro:/mnt/Storage/chexx" cfg.office.automount;
+ "/media/chexx/tkdocs" = mkNetworkFileSystem "poweredge-pro:/mnt/Storage/Users/Tim-Keller" cfg.office.automount;
+ "/media/chexx/scans" = mkNetworkFileSystem "poweredge-pro:/mnt/Storage/Scans" cfg.office.automount;
+ };
+ # TODO auto mkdirz
+ };
+}
diff --git a/modules/root/printing.nix b/users/timmy/printing.nix
index 69ff573..9dbba29 100644
--- a/modules/root/printing.nix
+++ b/users/timmy/printing.nix
@@ -1,33 +1,23 @@
{ lib, config, pkgs, ... }: {
- options = {
- printing.enable = lib.mkEnableOption "enables printing";
- avahi.enable = lib.mkEnableOption "enables avahi";
- scanning.enable = lib.mkEnableOption "enables scanning";
- };
-
- config = lib.mkIf config.printing.enable {
- services.printing = {
- enable = true;
- drivers = [
- pkgs.epson-escpr2
- ];
- };
-
- services.avahi = {
- enable = true;
- nssmdns4 = true;
- openFirewall = true;
- };
+ config = lib.mkIf config.services.printing.enable {
+ # Printer drivers
+ services.printing.drivers = [
+ pkgs.epson-escpr2
+ #pkgs.workcentre-7800-series
+ ];
- environment.systemPackages = with pkgs; pkgs.lib.optionals config.scanning.enable [
+ # Scanning programs
+ environment.systemPackages = with pkgs; [
epsonscan2
];
+ # Printers
networking.hosts = {
"192.168.1.35" = [ "Epson_ET-8500" ];
- "192.168.77.40" = [ "Xerox_WorkCentre_7855" ];
+ #"192.168.77.40" = [ "Xerox_WorkCentre_7855" ];
};
+ # Add printers to cups
hardware.printers.ensurePrinters = [
{
name = "Epson_ET-8500";
diff --git a/users/timmy/repos.nix b/users/timmy/repos.nix
new file mode 100644
index 0000000..eed0219
--- /dev/null
+++ b/users/timmy/repos.nix
@@ -0,0 +1,48 @@
+{ config, ... }: let
+ server = "https://git.tjkeller.xyz/";
+ # TODO find how to get home manager config instead of nixos config
+ #srcHome = "${config.xdg.userDirs.documents}/src";
+ #configHome = config.xdg.configHome;
+ home = "/home/timmy";
+ srcHome = "${home}/docs/src";
+ configHome = "${home}/.config";
+in {
+ config = {
+ home-manager.users.timmy = {
+ reposync.enable = true;
+ reposync.outOfStoreGitRepository = {
+ config = {
+ inherit server;
+ repository = "dotconfig";
+ targetPrefix = srcHome;
+ stow.".".targetPrefix = configHome;
+ };
+ nixos = {
+ inherit server;
+ targetPrefix = srcHome;
+ };
+ scripts = {
+ inherit server;
+ targetPrefix = srcHome;
+ stow."*".target = ".local/bin";
+ };
+ userscripts = {
+ inherit server;
+ targetPrefix = srcHome;
+ };
+ awesome = {
+ inherit server;
+ targetPrefix = configHome;
+ };
+ nvim = {
+ inherit server;
+ targetPrefix = configHome;
+ };
+ zsh = {
+ inherit server;
+ targetPrefix = configHome;
+ };
+ };
+ };
+ };
+}
diff --git a/users/timmy/resources/secrets/hashed-root-password.yaml b/users/timmy/resources/secrets/hashed-root-password.yaml
new file mode 100644
index 0000000..139f5c6
--- /dev/null
+++ b/users/timmy/resources/secrets/hashed-root-password.yaml
@@ -0,0 +1,52 @@
+hashed-root-password: ENC[AES256_GCM,data:7Qgoeb/6JPNupkHCBEzCs0FMP2cDEw972bjCRWeMrBrAMZzLsZc3Mbv03s1zLztUp6Ie93R5lVsamxKPUnaPt+Tnr/l+0E9aTmt7j7L6UzmWr12nj3FHxxTSU9ief6+ioIk+S4eICJspIQ==,iv:VoWP4qBCGzuYRpQw4nilUXByJ+ZwyZR/BdKowi+53DM=,tag:x6A00VCm8BEOhtv/WySXrQ==,type:str]
+sops:
+ age:
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBQVFp2V2syQ2VMMEFVTjBN
+ eTR4bml0aDhNYWxCYlFFdHBHTGpDWnJYb3g4CmZUVDNEd0tacGhUcEFIOEN6b0Ex
+ NDVSc1M1L25tTUZRdHlMTTVRbVFQYkkKLS0tIHgrT1RLRFZCVWw1RHdaM3h0TFRz
+ V2EySEtqamZFdnhWZFgrN1gwK0xUbkUK5QBwuG6YG0XM8U/tELhS0AClTGxmo63Z
+ M+s4KkI5u2zseme7GgWyzJSe1K4j0o0ig/c8VrVO55itW9i552eL0Q==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBTRkZGS0NBS1doSTBOcklq
+ ZmZ2ZjBWMkdvczlWc1ZuWjhxeGQ0OEh0STM4CmwvVWNCclU4TmZtcFozNWJDMlBS
+ YVVOUnZwcDV6cWlLczVWWE9ZMVF2L1UKLS0tIHljWEcxUEFTaW9OTk9pbGRpMndN
+ dnBhd1pTSEhxU3NBVkJWa3ZIeEdRalUKVfLRSR8lYe2wg1FNvRmv2JpzG36z62KF
+ hp2ZWbt1sHcRfVd35eCFnO7vLeD/24ncJzRmA+7x5XGq1uko0igrqQ==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1f0tmpy2nam58skmznjyqd3zf54rxtfrk6fda0vlpq9y3yg6wac7sjf0vja
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAzdkdDME5jbkVtQmEyWkh1
+ VTMwb2tXMDVNWmNNRUc4VThoenNvTjliWG1jClVLaEVJTnlBK0JMaTVBVUZNU0ZW
+ N3MxK21NSndTeGZkejZXK29SQ2hqUEkKLS0tIG1rNVlUSHQzT09yakJQOFVvbUpq
+ dld1bXcyT3AxU2grVVN1NDEvUnJJa0kK+XbGujEtMRWaZfsA+z0KHrJ3VwQwbISW
+ kAoMjz0ptTsTOWJKgAkU2W6EqbmPs/0K3i4OW6d53hOuHk1CPaRNNQ==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1zfvmt2avdlfz0fvchczplc84u7m8vqausm7zytl9s4x9m9yax4cqy30zpz
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA5dXdGWkw5NEtCbnhUekwx
+ Y3N4NGdOcVcwMUFwSVRzeGJBKzExb1dRTlJ3CmNmUnl0NDIwQUZDVzgzT2dTeFll
+ SDZBUHRWQm1FSW5Ndjl1TkxvUXl2bTQKLS0tIEdxVFJYSkdOck4xOGZnSjJjZUYy
+ Q2JBZ3J3aXhqTUtRTlJ4aE8wVWZvamMKejnjc2+G7etV8PJ9FjQLUEbgHu5O2qqH
+ uoly2UREBGcApNTNeZz5iOn0Gj8o60sE6Vl1GsBVUvhYnAfaQjK2xg==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1q8l3g3t6qjhsmz0gju0n535pz45d2c9crla8jcd5ftjlqe4fs3eqfqay0k
+ - enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBnTjA3bGZzb0F3NTVnY0Mw
+ elZEKzl2TG5kNklqVWg0NVpSNTk5cjB6cGpnCmVGSmU1VmJTSyt4NHJGeEdvYnlr
+ a2UvZzJhbzFGZnM1TkQyNHl0NytucmMKLS0tIGxSWnl6K1ZSdDFnTlBBcVFxdXBv
+ MmRUc1J2MFJ5UjltQVRpUk5zUis5OFUKGQ7DrLhvDZacQomMmlDaiUmMCXthI6wo
+ H41LHxI+5j8Giwlqt69YZGCY/h+/t/xXDOfOHADxOiKJGSoYa779RA==
+ -----END AGE ENCRYPTED FILE-----
+ recipient: age1fl4rk54n2xv4vssjkw4nywy93s4yqv69uzq2f64zuwd8fjq5u4cq9wmmsw
+ lastmodified: "2025-07-17T22:34:07Z"
+ mac: ENC[AES256_GCM,data:B95HuJC2o8B+P1f9kAtJTcSty7YSAByuqe/Xs6ce6780p05FuzWM5X9bwvwsYXngGNKqCHksWf50UXzJ3eyc6y4ISxdxljAv2FmJFKw4NkfGaOMiRLlGPMn1uFpOtkRT+qL0+mupWG/Ap3zcpbxjsDx46PUur+e6yRxlAHw8mGw=,iv:DYobhWK+4+7vOog7BrBASiHrEzzz0P6zqgWxexfcLG8=,tag:skGwUpDEB8e3TCjrxs5peA==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.10.2
diff --git a/users/timmy/resources/secrets/wpa_supplicant-conf.yaml b/users/timmy/resources/secrets/wpa_supplicant-conf.yaml
new file mode 100644
index 0000000..5f82025
--- /dev/null
+++ b/users/timmy/resources/secrets/wpa_supplicant-conf.yaml
@@ -0,0 +1,16 @@
+wpa_supplicant-conf: ENC[AES256_GCM,data:Hntld2CdmE9ef+2PANrTT4+IHGxYEkKaMFg9xUmPz6RXvrtS2oAIVYV8lFFQ8jltbtzW8eCgFOqz2NfwyDaOhqRv/xLK/4MVpVRG0njmYV2e0YtfSe3XBOwoQaVxHKl7hk92Yat5vFBJY79+w3DiM36/WBEY0RlxsKIViEU76JYMpNhqipaqlZG2IjfNTIv4y6DlHaKiolzNQagtvqhid3GmOkMoHaQp5nIp9taW81hWFZZbIZMnEFIO60z3p3LXvhDPCXfkoZRv7obbl/rXzLzp2lSOV7sBLRqy3it2SplP1tGOkePsDiBppHIrr9PXoyebY2+e8ACGPKv0tNmreEYthlHOxsmOuAGdWD3oZrGz/HA7h2YhHCnT4fQTpUj3vJ03LpnZ8RMzyxexAiAFVFh1JJ34etX+rHTzVgF7dN0nbZk3hb0YXQAj1lynDFYXIXkVfGq1hDRM/z9Q0JfB9Ef7iQVz4k0nO5QlyElWl1yBOjOWNoIibaysodDWRTxw21AWQ5GEEzMgG0AenHfzsrjUfSWUP5EKakiBGN0LduRyY5RmHQYbVHpkpP1PqCBmWBwm1xQ6JsOaajvNnc/x3fNZjIzCbGWprB/KbLnAbsF279cTIxzfMZEO3rHKxxsp,iv:h59506YhHe5Sq61StpMzGLRtx1Vr+pUoWquJeNjALh4=,tag:dS+7M5p8Xdpk6jfgzTk30w==,type:str]
+sops:
+ age:
+ - recipient: age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
+ enc: |
+ -----BEGIN AGE ENCRYPTED FILE-----
+ YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBxdXBUWXEvRU85Tk1lNWgz
+ ZHpENjdudmRuaEJIeVRHOHlDbWNzK0tQMGs4CmV6MVBpdE5PMTBWMm1PcDVFQ2VM
+ b0IwWDFxLy8xYUcxRVZFSEsyYlBFS1UKLS0tIHpCbDQ0a29TZlVFTGp4aXJCSmJ4
+ ZGxqMFQ1NDk1OHJIOUd0cVV0dzNNQlkKzYX36u0rEq6dMTCJf6OON6LzcEEnAB5A
+ +M9t3OKUUNtwgksjBUEwqBLJ1sU9amijpK63GUxwp74YDtsb0YXHiw==
+ -----END AGE ENCRYPTED FILE-----
+ lastmodified: "2026-03-07T16:00:28Z"
+ mac: ENC[AES256_GCM,data:pHvHTZVa9xxiblcWhemSaG6f9tu1KIk8eS8bj3F9guitTwXKdtSpAD6ZXn1IOWRFsAui8yrRjt9COdMjThOaOP2QjnOthJ3TDnfRaZnGoPBRzscsFLf2DApm6QBLokWEFP/1w6WxZQM/ajFo4qsxq0llym1146CEJ/hCqMMmWD8=,iv:GLLi3lIo2wusrZCBXfNMwj5fSoy/6tiP84yyRBXZhsc=,tag:8U+2YBYzx0Pw6OtXB5MsYQ==,type:str]
+ unencrypted_suffix: _unencrypted
+ version: 3.12.1
diff --git a/users/timmy/user.nix b/users/timmy/user.nix
new file mode 100644
index 0000000..2695549
--- /dev/null
+++ b/users/timmy/user.nix
@@ -0,0 +1,22 @@
+{ lib, config, pkgs, userDetails, ... }: let
+ cfg = config._archetypes.tjkeller.setPasswords;
+ hashedPasswordFile = config.sops.secrets.hashed-root-password.path;
+in {
+ options._archetypes.tjkeller.setPasswords = {
+ enable = lib.mkEnableOption "set users password. requires hashed root password from sops";
+ };
+
+ config = lib.mkIf cfg.enable {
+ # Load hashed root password secret
+ sops.secrets.hashed-root-password = {
+ sopsFile = ./resources/secrets/hashed-root-password.yaml;
+ neededForUsers = true;
+ };
+
+ # Apply password file
+ users.users = {
+ root = { inherit hashedPasswordFile; };
+ ${userDetails.username} = lib.mkIf config._archetypes.users.primary.enable { inherit hashedPasswordFile; };
+ };
+ };
+}
diff --git a/users/timmy/wifi.nix b/users/timmy/wifi.nix
new file mode 100644
index 0000000..ab5332f
--- /dev/null
+++ b/users/timmy/wifi.nix
@@ -0,0 +1,17 @@
+{ lib, config, ... }: let
+ cfg = config._users.timmy.wifi;
+in {
+ options._users.timmy.wifi = {
+ enable = lib.mkEnableOption "enables wifi";
+ };
+
+ config = lib.mkIf cfg.enable {
+ # Load wpa_supplicant.conf secret config
+ sops.secrets.wpa_supplicant-conf.sopsFile = ./resources/secrets/wpa_supplicant-conf.yaml;
+
+ networking.wireless = {
+ enable = true; # Enables wireless support via wpa_supplicant.
+ _extraSecretConfigs.networks = config.sops.secrets.wpa_supplicant-conf.path; # Load secret network config via systemd credential
+ };
+ };
+}