- Nix 100%
| .tack | ||
| home/brenna | ||
| hosts | ||
| lib | ||
| modules/nixos | ||
| pkgs | ||
| .envrc | ||
| .gitattributes | ||
| .gitignore | ||
| ci.nix | ||
| default.nix | ||
| README.md | ||
| shell.nix | ||
Br3nnabee's Modular, Multi-Device Nix Config
A flakeless, multi-host NixOS configuration for my desktop (cobalt) and
Framework laptop (nickel). Declarative $HOME via hjem & hjem-rum (no
home-manager), disko-managed full-disk encryption with impermanence and measured
boot (lanzaboote + systemd-pcrlock) on the laptop, a hardened Firefox via
Schizofox, nvf-built Neovim, gaming configs, and a bunch of other nifty
stuff. Currently Intel and Nvidia hardware; AMD is the eventual direction.
Feel free to use this as a template or example for your own config.
Layout
.tack/- dependency pins (tack: flake-like TOML pins, lazily fetched;pins.tomlis hand-editable,pins.lock.jsonis what Nix reads,default.nixis the vendored resolver)lib/-mkHostand shared helpershosts/<name>/- per-host config (hardware, disks, boot, option values)modules/nixos/- shared NixOS module tree behindhost.*optionshome/<user>/- per-user tree, evaluated inside hjem's user submodulepkgs/- local packages (endcord) pending upstreaming
Building
Flakeless, so no --flake:
nixos-rebuild switch -f . -A <host>
Update pins with tack update (the binary is in the dev shell; bootstrap with
nix run github:manic-systems/tack -- update).
First build on a fresh machine
Four things the commands above assume, which a fresh installer does not have:
-
Experimental features. The vendored resolver uses
builtins.fetchTree, which the installed system enables vianix.settings.experimental-features. That option only takes effect after a successful build, so pass it by hand for the first one (fetch-treeis the minimal flag on Nix 2.24+;flakesalso implies it):nixos-rebuild switch --file . --attr nickel \ --option extra-experimental-features fetch-tree -
Password hashes.
host.system.users.declarativePasswordreads/persist/passwords/<user>, which this repo does not create. On awipeRoothost withmutableUsers = false, forgetting it produces a machine you cannot log into. Before the first boot of a fresh install:mkdir -p /persist/passwords mkpasswd -m yescrypt > /persist/passwords/<user> chmod 600 /persist/passwords/<user> -
Privileged nix operations need
sudo.trusted-usersis["root"]only, so adding a substituter or cache key is a change tomodules/nixos/system/nix-daemon.nixrather than a CLI flag.nixos-rebuildandnh oselevate themselves; plainnix build/nix develop/nix evalagainst the configured substituters need no elevation. -
Secure Boot keys.
host.boot.securebootexpects an enrolled key hierarchy at/persist/secureboot(sbctl create-keys+sbctl enroll-keys). Oncobalt, which dual-boots Windows, enrolment must include Microsoft's CA (sbctl enroll-keys --microsoft), or the Windows boot entry and the ESP sync inmodules/nixos/boot/windows-dualboot.nixsilently stop working. That sync is a manual command: runsudo sync-windows-bootafter a Windows update that touched its bootloader.