No description
  • Nix 56.8%
  • C++ 14.8%
  • Python 13.9%
  • Shell 5.8%
  • JavaScript 3.7%
  • Other 5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-12-02 22:20:13 +02:00
.forgejo/workflows fix: correct user 2026-11-18 07:52:41 +02:00
alloy feat(monitoring): run telegraf and alloy natively from unstable 2026-11-03 22:35:22 +02:00
assets feat(plasma): loading 2026-11-11 05:46:45 +02:00
dashboards feat(monitoring): run victoriametrics, loki and grafana natively 2026-11-03 22:01:50 +02:00
docs feat: tesla work 2026-12-02 18:13:33 +02:00
hosts feat: move gns3 2026-12-02 19:22:16 +02:00
lib feat(plasma): loading 2026-11-11 05:46:45 +02:00
modules fix: gns3 deps 2026-12-02 22:20:13 +02:00
pkgs feat(plasma): loading 2026-11-11 05:46:45 +02:00
scripts feat: changes, update 2026-11-23 14:15:55 +02:00
secrets feat: move gns3 2026-12-02 19:22:16 +02:00
.gitattributes feat: auto resolve lock file conflict 2026-11-09 15:00:00 +02:00
.gitignore feat(nix): auto build 2026-11-13 00:47:30 +02:00
.sops.yaml feat: migrate 2026-11-29 22:07:21 +02:00
domctl.toml feat: domctl 2026-11-04 14:13:14 +02:00
flake.lock chore: update 2026-12-02 20:38:12 +02:00
flake.nix feat: migrate 2026-11-29 22:07:21 +02:00
justfile feat: tesla work 2026-12-02 18:13:33 +02:00
README.md feat: partial raspi 2026-11-15 19:09:39 +02:00

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 in hosts/; the directory name is the hostname and the nixosConfigurations name.
  • hosts/<name>/: host entry point, hardware, authorised public keys, and system packages as ordinary Nix (pkgs is the host's own channel, stable and unstable reach the others), and an optional services.toml that domctl edits (the enabled modules under modules/services/ and modules/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, the services.toml loader (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 with my.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 that domctl uses to match services to their modules.
  • pkgs/: packages that nixpkgs lacks. The author's own applications come from the d-packages flake input instead.
  • alloy/, dashboards/, scripts/: files that native service modules read.
  • assets/: images shared by several modules, reached through lib/assets.nix. lib/: small Nix helpers.
  • **/resources/: every file that is not Nix (scripts, QML, JavaScript, YAML, keys, vendored sources) sits in a resources/ folder next to the Nix file that uses it; see docs/conventions.md.
  • docs/operations.md: how to run, update and roll back the server.
  • docs/pi-gateway.md: the Raspberry Pi gateway dom-pi: which just recipes run where, the hotspot uplink, and the parked first switch.
  • secrets/: sops-encrypted values only.

Adding a host

  1. Create hosts/<hostname>/default.nix that imports ../../modules/profiles/base.nix, the modules the machine needs, and ../../modules/system/manifests.nix if it has a services.toml; set my.user.name, nixpkgs.hostPlatform and system.stateVersion, and add hardware.nix.
  2. 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.
  3. Declare packages in a packages.nix (or a packages/ folder) with environment.systemPackages, and optionally add a services.toml; domctl edits the latter for whichever host it runs on (--host or NIXOS_HOST to pick another).
  4. Add the machine's age key to .sops.yaml before importing modules/security/secrets.nix.
  5. Build it with just build on that machine, or NIXOS_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.bootGuard stops Docker after three boots within thirty minutes (boot-guard status, sudo boot-guard reset).
  • my.scheduledReboot reboots 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.