Imported from FaustXVI/nixos-configuration (
AGENTS.md). Install upstream withnpx skills add FaustXVI/nixos-configuration. Copyright stays with the author.
AGENTS.md
Architecture
- Flake root:
flake.nix— discovers machines by scanningmachines/*.nix(any.nixfile becomes a flake output) - Machine config:
machines/<name>.nix— declaresxadetComputer.type(laptop|desktop) andxadetComputer.purposes - Module composition:
modules/default.nixauto-imports all subdirs/files viaimportAllFilteredWith; same pattern inmodules/purposes/,modules/hardware/,modules/system/ - Home-manager: configs in
modules/system/home-manager/, per-user files:xad.nix,root.nix - Purposes: composable feature sets — create
modules/purposes/<name>/default.nixand list in a machine'spurposesarray - Hardware detection:
nixos-facter-modulesauto-detects hardware viafacter.reportPathJSON. Disk device auto-detected from facter report; override by passingdeviceexplicitly.
Commands
# Build and switch a machine (requires sudo)
sudo nixos-rebuild switch --flake .#<machine-name>
# Build only (no sudo needed)
nixos-rebuild build --flake .#<machine-name>
# List available machines
nix flake show .
# Enter dev shell (sops + age)
nix develop --flake .
Agents cannot use sudo. Use
nixos-rebuild buildto verify configurations without switching.
Secrets
- SOPS config:
.sops.yaml— age keyage149suhqjf8zk8phwuvh7lztw79qxmrajdp5uqfhtrd6p8wnss0sssu2qs58 - Age key:
keys/ageKey.txt(gitignored, GPG-decrypted atkeys/ageKey.txt.gpg) - Dev shell sets
SOPS_AGE_KEY_FILEautomatically via shellHook - Encrypted files:
secrets/*+modules/purposes/*/secrets/*(nested secrets not covered by.sops.yamlpath_regex, encrypt manually) - To edit a secret:
sops <file>(fromnix develop)
Machine-specific notes
- eove: laptop, TPM + lanzaboote (UEFI secure boot), Hyprland, purposes: work/home-office/gaming/3dPrinting
- cnc: laptop, GNOME (Hyprland/greetd forced off), purposes: cnc
- desktop-home: desktop, ROCm GPU (pkgs/overlay), Hyprland, Sunshine, purposes: perso/gaming/youtube/photo/home-office/3dPrinting/llm
- All machines: LUKS + disko (GPT + ESP + encrypted swap + ext4 root), stateVersion
24.11 hardware-configuration.nixandconfiguration.nixare gitignored
Adding a new machine
- Create
machines/<name>.nixwithxadetComputerdeclaration andfacter.reportPath - Import
./common/luks-interactive-login.nixwith the disk device - Set
system.stateVersion - Add machine-specific overlays/configs as needed
Adding a new purpose
- Create
modules/purposes/<name>/default.nixthat imports its submodules - Add any machine to the purpose via
purposes = [ ... "<name>" ... ]
Style conventions
mkForceused to override defaults from other modules (common pattern)mylib.computerIs/mylib.computerHasPurposefor conditional confignixpkgs.config.allowUnfree = truein unstable pkgs import;rocmSupport = truein pkgs importnixos-26.05branch locked via flake.lock