No description
- Nix 56.8%
- C++ 14.8%
- Python 13.9%
- Shell 5.8%
- JavaScript 3.7%
- Other 5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| alloy | ||
| assets | ||
| dashboards | ||
| docs | ||
| hosts | ||
| lib | ||
| modules | ||
| pkgs | ||
| scripts | ||
| secrets | ||
| .gitattributes | ||
| .gitignore | ||
| .sops.yaml | ||
| domctl.toml | ||
| flake.lock | ||
| flake.nix | ||
| justfile | ||
| README.md | ||
NixOS configurations
Declarative description of the machines in this repository; the home server dom-server, the desktop and laptop, and the Raspberry Pi gateway dom-pi. Secrets are never stored here in plain text; they live in secrets/ encrypted with sops-nix and age. Persistent data lives in /data and is not part of this repository.
Layout
flake.nix: inputs (stable 26.05, a locked unstable channel for selected packages, sops-nix, d-packages) and one system per directory inhosts/; the directory name is the hostname and thenixosConfigurationsname.hosts/<name>/: host entry point, hardware, authorised public keys, and system packages as ordinary Nix (pkgsis the host's own channel,stableandunstablereach the others), and an optionalservices.tomlthatdomctledits (the enabled modules undermodules/services/andmodules/containers/).modules/profiles/base.nix: what every machine gets: channels (unstable, unfree), the main user (my.user.name), locale, zram, Nix settings.modules/system/: the shared modules above, theservices.tomlloader (manifests.nix), and the server-only parts: boot, storage, container groups and pinned IDs (ids.nix), power, host timers, data ownership rules, and the server options (server-options.nix).modules/hardware/: NVIDIA driver, AIO fan control.modules/networking/: interface, firewall, SSH, Caddy, the CrowdSec firewall bouncer and the VPN namespaces.modules/security/: sops secrets and the derived secret names.modules/virtualisation/: Docker, the edge networks, libvirt.modules/services/: native services, grouped where a group fits (metrics/,auth/,messaging/,home/,media/,apps/); each module also declares its own Caddy site withmy.caddy.sites.<name>.modules/containers/: the services that still run as containers, one module per compose stack, each with its Caddy site.domctl.toml: aliases and extra units thatdomctluses to match services to their modules.pkgs/: packages that nixpkgs lacks. The author's own applications come from thed-packagesflake input instead.alloy/,dashboards/,scripts/: files that native service modules read.assets/: images shared by several modules, reached throughlib/assets.nix.lib/: small Nix helpers.**/resources/: every file that is not Nix (scripts, QML, JavaScript, YAML, keys, vendored sources) sits in aresources/folder next to the Nix file that uses it; seedocs/conventions.md.docs/operations.md: how to run, update and roll back the server.docs/pi-gateway.md: the Raspberry Pi gatewaydom-pi: whichjustrecipes run where, the hotspot uplink, and the parked first switch.secrets/: sops-encrypted values only.
Adding a host
- Create
hosts/<hostname>/default.nixthat imports../../modules/profiles/base.nix, the modules the machine needs, and../../modules/system/manifests.nixif it has aservices.toml; setmy.user.name,nixpkgs.hostPlatformandsystem.stateVersion, and addhardware.nix. - Put the public keys in
hosts/<hostname>/resources/authorized_keys. Without a key or a password, NixOS refuses to build the system, which protects against locking yourself out. - Declare packages in a
packages.nix(or apackages/folder) withenvironment.systemPackages, and optionally add aservices.toml;domctledits the latter for whichever host it runs on (--hostorNIXOS_HOSTto pick another). - Add the machine's age key to
.sops.yamlbefore importingmodules/security/secrets.nix. - Build it with
just buildon that machine, orNIXOS_HOST=<hostname> just build.
Nothing is shared implicitly: a module only applies to hosts that import it, so server modules never reach another machine.
Safety during migration
- The newest NixOS generation is the default boot entry; the previous system stays selectable in the 3 second boot menu.
my.bootGuardstops Docker after three boots within thirty minutes (boot-guard status,sudo boot-guard reset).my.scheduledRebootreboots on Thursday at 03:00 after seven days of uptime.- Data mounts are soft (
nofail) so SSH stays reachable; container units still require their bind mount paths.