NixOS configuration
Flake-based NixOS + home-manager configuration for this desktop.
Layout
flake.nix # entrypoint; pins nixpkgs + home-manager
hosts/
pc-mans/ # one directory per machine
default.nix # host-specific (hostname, stateVersion, host LUKS)
hardware-configuration.nix # generated, host-specific; do not edit by hand
modules/
system/ # NixOS modules (system-wide concerns)
default.nix # imports the rest
boot.nix
locale.nix
networking.nix
nix.nix # flakes, gc, registry, allowUnfree
hardware-amd.nix # AMD CPU microcode + amdgpu/Mesa/Vulkan
audio.nix # PipeWire
fonts.nix
sway.nix # programs.sway, SDDM, portals, polkit
users.nix
packages.nix # system-wide packages
home/ # home-manager modules (per-user concerns)
default.nix
sway.nix # keybinds, bar, idle, lock, notifications
shell.nix # bash, tmux, direnv, fzf, eza, bat
git.nix
packages.nix
home/
mans.nix # home-manager entry for user `mans` (NixOS hosts)
mans-remote.nix # standalone home-manager: headless/CLI-only boxes
mans-spup.nix # standalone home-manager: SPUP workstation (CLI + GUI apps)
First-time switch
The current system still boots from /etc/nixos/configuration.nix. To switch
to this flake-managed config:
# Sanity-check the build first (does not activate):
sudo nixos-rebuild build --flake ~/nixos#pc-mans
# Activate for this boot only (reverts on reboot):
sudo nixos-rebuild test --flake ~/nixos#pc-mans
# Make it the default boot entry:
sudo nixos-rebuild switch --flake ~/nixos#pc-mans
Once the switch succeeds you can ignore /etc/nixos/ entirely. (Removing it
is fine; the flake doesn't read from there.)
Day-to-day
nrs # alias: rebuild switch
nrt # alias: rebuild test
nfu # alias: flake update
Or the long forms:
sudo nixos-rebuild switch --flake ~/nixos#pc-mans
nix flake update ~/nixos
Standalone home-manager (non-NixOS machines)
On machines that aren't managed by this flake's NixOS configs (a work box, a
remote server, another distro), home-manager runs on its own — no root, no
nixos-rebuild. The flake exposes these under homeConfigurations:
| Config | Entry | For |
|---|---|---|
mans-remote |
home/mans-remote.nix |
Headless/CLI-only: shell, fish, tmux, git, neovim, antigravity-cli, pandoc, diagnostic + CLI utils |
mans-spup |
home/mans-spup.nix |
SPUP workstation: the same CLI base plus claude, zotero, pandoc, zathura, librewolf |
Both assume user mans with $HOME at /home/mans and target x86_64-linux.
Bootstrap on a fresh machine
-
Install Nix (the Determinate Systems installer enables flakes out of the box):
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- installWith the upstream installer instead, enable flakes first:
mkdir -p ~/.config/nix echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf -
Clone this repo:
git clone git@git.mziesel.nl:mans/nixos-config.git ~/nixos -
Activate — the first time there is no
home-managerbinary yet, so run it straight from the flake:nix run home-manager/master -- switch --flake ~/nixos#mans-spup(Use
#mans-remoteon headless boxes.) This installshome-manageritself, since the configs setprograms.home-manager.enable = true.
Day-to-day
home-manager switch --flake ~/nixos#mans-spup # apply changes
home-manager build --flake ~/nixos#mans-spup # dry build, no activation
nix flake update ~/nixos # bump inputs, then switch again
The nrs / nrt aliases are NixOS-only and won't work here.
To roll back:
home-manager generations # list previous generations
/nix/store/...-home-manager-generation/activate # run activate from the one you want
Adding another standalone config
- Copy
home/mans-remote.nixtohome/<name>.nixand adjust the imports frommodules/home/. - Add
"<name>" = mkHome ./home/<name>.nix;tohomeConfigurationsinflake.nix—mkHomesuppliespkgs(withallowUnfree+ the NUR overlay) andinputs. home-manager switch --flake ~/nixos#<name>.
Updating inputs
nix flake update ~/nixos # bumps nixpkgs + home-manager
sudo nixos-rebuild switch --flake ~/nixos#pc-mans
To roll back if something breaks:
sudo nixos-rebuild switch --rollback
Hardware notes
- CPU: AMD Ryzen 9 9950X3D (Zen 5). Microcode updates enabled via
hardware.cpu.amd.updateMicrocode. - GPU: AMD Radeon RX 9070 (RDNA 4, Navi 48). Requires recent kernel + Mesa;
we use
boot.kernelPackages = pkgs.linuxPackages_latestand Mesa from nixos-25.11. Both RADV (Mesa) and AMDVLK are installed; RADV is the default. - iGPU: Granite Ridge integrated graphics on the 9950X3D. Same
amdgpudriver, no extra config. - WiFi: Qualcomm WCN785x (FastConnect 7800 / Wi-Fi 7). Firmware ships in
linux-firmwarewhich is pulled in byhardware.enableRedistributableFirmware. - Ethernet: Realtek RTL8126 (5GbE). Handled by the in-tree
r8169driver.
Adding a new host
mkdir hosts/<name>and copyhosts/pc-mans/default.nixas a starting point.- Drop
hardware-configuration.nixfromnixos-generate-configinto it. - Add a
nixosConfigurations.<name>entry toflake.nix.