From 5f23518f811618171e489541c1421ca9ecd30c22 Mon Sep 17 00:00:00 2001 From: alexion Date: Thu, 3 Sep 2026 19:21:19 -0400 Subject: [PATCH 1/3] feat(nixos): add zeus desktop host --- configs/nixos/hosts/zeus/default.nix | 41 +++++++++++++ configs/nixos/hosts/zeus/disk.nix | 61 +++++++++++++++++++ .../hosts/zeus/hardware-configuration.nix | 18 ++++++ 3 files changed, 120 insertions(+) create mode 100644 configs/nixos/hosts/zeus/default.nix create mode 100644 configs/nixos/hosts/zeus/disk.nix create mode 100644 configs/nixos/hosts/zeus/hardware-configuration.nix diff --git a/configs/nixos/hosts/zeus/default.nix b/configs/nixos/hosts/zeus/default.nix new file mode 100644 index 0000000..98bbca4 --- /dev/null +++ b/configs/nixos/hosts/zeus/default.nix @@ -0,0 +1,41 @@ +{ pkgs, ... }: +# zeus — Ryzen desktop with AMD graphics. +# Disk layout is in ./disk.nix. +# `fileSystems` are derived from it, none declared here. +{ + imports = [ + ./hardware-configuration.nix + ./disk.nix + ]; + + system.stateVersion = "26.05"; + + # systemd-boot on the EFI system partition. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Keep the desktop on a recent kernel for new AMD GPU support. + boot.kernelPackages = pkgs.linuxPackages_latest; + + hardware.enableRedistributableFirmware = true; + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + # RAM-backed swap, no on-disk swap partition. + zramSwap.enable = true; + + networking.networkmanager.enable = true; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + + modules.desktop.enable = true; + modules.desktop.apps.steam.enable = true; + + time.timeZone = "America/New_York"; + i18n.defaultLocale = "en_GB.UTF-8"; +} diff --git a/configs/nixos/hosts/zeus/disk.nix b/configs/nixos/hosts/zeus/disk.nix new file mode 100644 index 0000000..c14614c --- /dev/null +++ b/configs/nixos/hosts/zeus/disk.nix @@ -0,0 +1,61 @@ +{ ... }: +# zeus's disk layout for disko: one NVMe disk, GPT, with an EFI system +# partition and a LUKS container holding btrfs subvolumes. +# No swap partition, since swap is zram. +# disko derives `fileSystems` and `boot.initrd.luks.devices` from this. +{ + disko.devices.disk.main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "2G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "cryptroot"; + settings.allowDiscards = true; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "@root" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@home" = { + mountpoint = "/home"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/configs/nixos/hosts/zeus/hardware-configuration.nix b/configs/nixos/hosts/zeus/hardware-configuration.nix new file mode 100644 index 0000000..65c6e8d --- /dev/null +++ b/configs/nixos/hosts/zeus/hardware-configuration.nix @@ -0,0 +1,18 @@ +{ lib, modulesPath, ... }: +# Hardware inferred from the CachyOS inventory for this desktop. +# disko derives `fileSystems` and the LUKS device, none declared here. +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ + "ahci" + "nvme" + "sd_mod" + "xhci_pci" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} -- 2.47.3 From c87c8319c05d9a7207c4a3583c59af74a8e53577 Mon Sep 17 00:00:00 2001 From: alexion Date: Thu, 3 Sep 2026 19:42:14 -0400 Subject: [PATCH 2/3] fix(nixos): defer zeus hardware detection --- configs/nixos/AGENTS.md | 2 ++ configs/nixos/hosts/zeus/default.nix | 8 +++----- .../hosts/zeus/hardware-configuration.nix | 18 ------------------ 3 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 configs/nixos/hosts/zeus/hardware-configuration.nix diff --git a/configs/nixos/AGENTS.md b/configs/nixos/AGENTS.md index a1e2c3d..27dd8fa 100644 --- a/configs/nixos/AGENTS.md +++ b/configs/nixos/AGENTS.md @@ -46,3 +46,5 @@ Use a host-visible owner plus a shared group mode when the guest service can read the decrypted secret file through its group. - Pikachu deploys from the monorepo checkout copied to `~/dev`. Do not use the old `~/wrk/dotfiles` path for remote rebuild commands. +- Do not hand-author `hardware-configuration.nix` for a host that has not been generated on that machine. + Generate it on the target system or live ISO, then stage it before evaluating the flake. diff --git a/configs/nixos/hosts/zeus/default.nix b/configs/nixos/hosts/zeus/default.nix index 98bbca4..095fd2a 100644 --- a/configs/nixos/hosts/zeus/default.nix +++ b/configs/nixos/hosts/zeus/default.nix @@ -1,14 +1,12 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: # zeus — Ryzen desktop with AMD graphics. # Disk layout is in ./disk.nix. # `fileSystems` are derived from it, none declared here. { - imports = [ - ./hardware-configuration.nix - ./disk.nix - ]; + imports = [ ./disk.nix ] ++ lib.optional (builtins.pathExists ./hardware-configuration.nix) ./hardware-configuration.nix; system.stateVersion = "26.05"; + nixpkgs.hostPlatform = "x86_64-linux"; # systemd-boot on the EFI system partition. boot.loader.systemd-boot.enable = true; diff --git a/configs/nixos/hosts/zeus/hardware-configuration.nix b/configs/nixos/hosts/zeus/hardware-configuration.nix deleted file mode 100644 index 65c6e8d..0000000 --- a/configs/nixos/hosts/zeus/hardware-configuration.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ lib, modulesPath, ... }: -# Hardware inferred from the CachyOS inventory for this desktop. -# disko derives `fileSystems` and the LUKS device, none declared here. -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.availableKernelModules = [ - "ahci" - "nvme" - "sd_mod" - "xhci_pci" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} -- 2.47.3 From 40688acc0db33146354565f9e31b5b62bbb51369 Mon Sep 17 00:00:00 2001 From: alexion Date: Thu, 3 Sep 2026 19:53:03 -0400 Subject: [PATCH 3/3] refactor(nixos): align zeus with neogaia --- configs/nixos/hosts/zeus/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/configs/nixos/hosts/zeus/default.nix b/configs/nixos/hosts/zeus/default.nix index 095fd2a..7009983 100644 --- a/configs/nixos/hosts/zeus/default.nix +++ b/configs/nixos/hosts/zeus/default.nix @@ -12,8 +12,7 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - # Keep the desktop on a recent kernel for new AMD GPU support. - boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = pkgs.linuxPackages_cachyos; hardware.enableRedistributableFirmware = true; hardware.graphics = { @@ -31,7 +30,13 @@ powerOnBoot = true; }; + modules.monorepo.enable = true; + modules.shell.herdr.enable = true; + modules.shell.gitea-axi.enable = true; + modules.shell.pi.enable = true; + modules.desktop.enable = true; + modules.desktop.apps.obsidian.enable = true; modules.desktop.apps.steam.enable = true; time.timeZone = "America/New_York"; -- 2.47.3