2026-09-08 16:28:41 +02:00
2026-06-01 22:32:25 +02:00
2026-05-23 18:34:56 +02:00
2026-09-08 16:28:41 +02:00
2026-09-08 09:41:21 +02:00
2026-09-08 16:28:41 +02:00
2026-09-08 16:28:41 +02:00
2026-07-27 13:16:39 +02:00
2026-09-08 16:28:41 +02:00

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

  1. 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 -- install
    

    With the upstream installer instead, enable flakes first:

    mkdir -p ~/.config/nix
    echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf
    
  2. Clone this repo:

    git clone git@git.mziesel.nl:mans/nixos-config.git ~/nixos
    
  3. Activate — the first time there is no home-manager binary yet, so run it straight from the flake:

    nix run home-manager/master -- switch --flake ~/nixos#mans-spup
    

    (Use #mans-remote on headless boxes.) This installs home-manager itself, since the configs set programs.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

  1. Copy home/mans-remote.nix to home/<name>.nix and adjust the imports from modules/home/.
  2. Add "<name>" = mkHome ./home/<name>.nix; to homeConfigurations in flake.nixmkHome supplies pkgs (with allowUnfree + the NUR overlay) and inputs.
  3. 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_latest and 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 amdgpu driver, no extra config.
  • WiFi: Qualcomm WCN785x (FastConnect 7800 / Wi-Fi 7). Firmware ships in linux-firmware which is pulled in by hardware.enableRedistributableFirmware.
  • Ethernet: Realtek RTL8126 (5GbE). Handled by the in-tree r8169 driver.

Adding a new host

  1. mkdir hosts/<name> and copy hosts/pc-mans/default.nix as a starting point.
  2. Drop hardware-configuration.nix from nixos-generate-config into it.
  3. Add a nixosConfigurations.<name> entry to flake.nix.
S
Description
New NixOS config
Readme
3.3 MiB
Languages
Nix 99.2%
Shell 0.8%