A modular, flake-based NixOS and Home Manager configuration managing a multi-machine desktop and homelab fleet from a single repository.
Configured via lib/mkHost.nix (and nixos-raspberrypi for rowan), with per-host and shared network settings centralized in fleet-settings.nix:
| Host | Arch | Role / Modules | Notes |
|---|---|---|---|
| lotus | x86_64-linux |
Laptop (modules/pc/laptop, modules/pc/shared) |
Home Manager (nic@lotus), Steam/packages/unstable overlays |
| cedar | x86_64-linux |
Desktop (modules/pc/desktop, modules/pc/shared) |
Home Manager (nic@cedar), AI, gaming, and audio modules |
| sequoia | x86_64-linux |
Tower / Server (modules/server/tower, modules/server/shared) |
routing = true, tmpfs impermanence, rootless pods, self-hosted services |
| aspen | x86_64-linux |
AI Server (modules/server/ai, modules/server/shared) |
cudaSupport = true, local inference, speech, VM |
| juniper | aarch64-linux |
Assistant / Pi (modules/server/assistant, modules/server/pis, modules/server/shared) |
Includes aarch64 SD image builder |
| rowan | aarch64-linux |
Dashboard / Pi 5 (modules/server/dashboard, modules/server/pis) |
Built with nixos-raspberrypi (raspberry-pi-5.base, sd-image) |
| installer | x86_64-linux |
ISO (modules/iso.nix) |
Custom bootstrap/installer image |
.
├── flake.nix # Inputs, dev templates, nixosConfigurations, and homeConfigurations
├── fleet-settings.nix # Network config, host IPs/ports, and rootless pod UID/subUID mappings
├── lib/
│ ├── mkHost.nix # NixOS system builder (pkgs, overlays, sops, fleetSettings, loadModules)
│ ├── mkHome.nix # Home Manager configuration builder
│ ├── mkPod.nix # Rootless Podman user + subUid/subGid + /persist helper
│ ├── load-modules.nix # Directory `.nix` auto-loader (ignores `default.nix`, `_*`, `*~`)
│ └── gen-certs.sh # Local CA & server cert generator encrypted via sops
├── modules/
│ ├── shared/ # Base NixOS modules applied to all mkHost machines
│ ├── custom/ # Reusable custom NixOS modules (adguard, nginx, syncthing, etc.)
│ ├── pc/ # Desktop (`cedar`), laptop (`lotus`), and shared PC modules
│ ├── server/ # Tower (`sequoia`), AI (`aspen`), assistant, dashboard, Pi, and shared server modules
│ ├── home/ # Home Manager configs (`shared`, `cedar`, `lotus`)
│ └── iso.nix # Installer ISO configuration
├── overlays/ # `unstable`, `packages`, `steam`, `python-pin`, `rpi-go125`
├── pkgs/ # Custom packages (`kairo`, `tide-island`)
├── nvf/ # Neovim configuration via `nvf` (`nvFN.nix`, `nvf-configuration.nix`)
├── dotfiles/ # `mpv` config and `noctalia` shell config, colorschemes, and plugins
├── devFlakes/ # Flake templates (`java`, `jupyter`, `javascript`, `openSCAD`, `network`)
├── assets/ # Wallpapers and SVG icons
├── certs/ # Local CA public certificate (`ca.pem`)
├── secrets/ # `sops-nix` encrypted secrets (`global.yaml`, `tower.yaml`, `laptop.yaml`, `certs.yaml`)
└── shell/ # Zsh configuration and aliases
- Builders (
lib/mkHost.nix&lib/mkHome.nix): Standardize NixOS and Home Manager evaluation across hosts.mkHostautomatically importsmodules/shared,modules/custom, andsops-nix, sets up a singlepkgsuniverse with overlays, and passesfleetSettings,networkSettings, andloadModulesviaspecialArgs. - Automatic Module Loading (
lib/load-modules.nix):loadModules ./.imports all regular.nixfiles in a directory while ignoringdefault.nix, files prefixed with_(disabled/WIP modules), and editor backup files (*~). - Base System (
modules/shared/): Configures flakes,America/New_Yorktimezone,neovimas default editor,zsh(pureprompt) with symlinked shell configs, Tailscale mesh VPN,sops-nix, and trusts the internal CA (certs/ca.pem). - Secrets & Internal TLS (
secrets/,certs/,lib/gen-certs.sh):- Admin workstations (
lotus,cedar) decrypt secrets using/home/nic/.config/sops/age/keys.txt. - Servers derive age keys automatically from their SSH host keys (
/persist/etc/ssh/ssh_host_ed25519_keyonsequoia,/etc/ssh/ssh_host_ed25519_keyelsewhere). lib/gen-certs.shgenerates or reuses the local CA (certs/ca.pem+ca-keyinsecrets/tower.yaml) and issues 825-day SAN certificates (secrets/certs.yaml) covering all enabled vhosts insequoia'smy.reverseProxyconfig.
- Admin workstations (
- Impermanence & Rootless Pods (
sequoia&lib/mkPod.nix):sequoiaruns withimpermanencemounted at/persist, preserving system state (/var/log,/var/lib/nixos,/var/lib/systemd, Tailscale state,/etc/machine-id, and SSH host keys).mkPodprovisions isolated non-login users with dedicatedsubUidRanges/subGidRanges, lingering systemd user sessions for rootless Podman containers, and/persist/home/<pod>storage.
- Desktop & Home Manager (
modules/home/,nvf/): Manages user environments (nic@lotus,nic@cedar) including Niri, Alacritty, Zen Browser, Yazi, Vicinae, Zed,nvf-configured Neovim, and Noctalia shell, withnh(flake = "/home/nic/nix-fleet/") andnix-direnvenabled on PCs.
Initialize an isolated devenv + direnv environment from devFlakes/:
nix flake init -t ~/nix-fleet#<template>
direnv allowAvailable templates: java, jupyter, javascript, scad (devFlakes/openSCAD), and network.
# Rebuild / switch a NixOS host (uses /home/nic/nix-fleet/ on PCs)
nh os switch
# Update flake inputs and rebuild
nh os switch --update
# Switch Home Manager configuration
nh home switch # or: home-manager switch --flake .#nic@lotus
# Build an SD card image (rowan or juniper)
nix build .#nixosConfigurations.rowan.config.system.build.sdImage
# Generate/renew local CA & server certificates (valid 825 days)
nix-shell -p openssl sops jq git --run 'bash lib/gen-certs.sh'- Disko (
diskoinput): Available inflake.nixfor post-install disk partitioning, though not imported directly into host configs—disk layouts anddrives.nixmodules must be adapted per machine before running. - Planned:
- Migrate
dotfiles/noctaliaconfiguration and plugins into Home Manager. - Implement
deploy-rs(input already wired inflake.nix) for remote fleet deployments.
- Migrate