Consolidate fleet boilerplate and refine module boundaries #276

Closed
opened 2026-10-06 20:08:48 +01:00 by nimmo · 1 comment
Owner

Context & Problem

Several configuration boundaries across the fleet exhibit DRY violations or non-idiomatic patterns:

  1. Nova remote builder boilerplate: lena, vega, lyra, and chaos all declare identical sops.secrets."nix-remote-builder/<host>-private-key" and nixosConfig.novaRemoteBuilder settings.
  2. Duplicate Nebula IP definitions: Every host's overlay IP is defined in hostMap inside modules/networking/nebula.nix AND explicitly repeated in each host configuration (nixosConfig.nebula.overlayIp = ...).
  3. Plasma Manager on headless servers: flake.nix unconditionally includes plasma-manager in home-manager.sharedModules for all hosts, forcing headless servers (Vega, Lyra) to evaluate it and triggering rebuilds in auto-update-policy.nix.
  4. Redundant Home Manager extraSpecialArgs: flake.nix passes primaryUser, isServer, flakeRepo, userEmail, and hostName to Home Manager via extraSpecialArgs, when NixOS-integrated Home Manager modules already receive osConfig.
  5. Dead code: home/nimmo.nix is an unused compatibility stub that flake.nix bypasses.

Scope

  • flake.nix
  • modules/common/nova-remote-builder.nix
  • modules/networking/nebula.nix
  • lib/auto-update-policy.nix
  • home/users/nimmo/
  • home/nimmo.nix

Implementation Checklist

  • Make nova-remote-builder.nix automatically declare the host's sops secret and default sshKeyFile based on config.networking.hostName. Remove the repeated 15-line boilerplate from lena, vega, lyra, and chaos.
  • Make nixosConfig.nebula.overlayIp default to hostMap.${config.networking.hostName} so hosts only need nixosConfig.nebula.enable = true.
  • Scope plasma-manager.homeModules.plasma-manager to desktop hosts in flake.nix (or desktop home-manager imports) rather than sharedModules on all hosts; update auto-update-policy.nix accordingly.
  • Refactor Home Manager modules to access osConfig directly, cleaning up redundant extraSpecialArgs in flake.nix.
  • Remove dead file home/nimmo.nix.

Completion Criteria

  • Flake check passes on all hosts.
  • Rebuilding hosts is verified without regressions.
## Context & Problem Several configuration boundaries across the fleet exhibit DRY violations or non-idiomatic patterns: 1. **Nova remote builder boilerplate:** `lena`, `vega`, `lyra`, and `chaos` all declare identical `sops.secrets."nix-remote-builder/<host>-private-key"` and `nixosConfig.novaRemoteBuilder` settings. 2. **Duplicate Nebula IP definitions:** Every host's overlay IP is defined in `hostMap` inside `modules/networking/nebula.nix` AND explicitly repeated in each host configuration (`nixosConfig.nebula.overlayIp = ...`). 3. **Plasma Manager on headless servers:** `flake.nix` unconditionally includes `plasma-manager` in `home-manager.sharedModules` for all hosts, forcing headless servers (Vega, Lyra) to evaluate it and triggering rebuilds in `auto-update-policy.nix`. 4. **Redundant Home Manager `extraSpecialArgs`:** `flake.nix` passes `primaryUser`, `isServer`, `flakeRepo`, `userEmail`, and `hostName` to Home Manager via `extraSpecialArgs`, when NixOS-integrated Home Manager modules already receive `osConfig`. 5. **Dead code:** `home/nimmo.nix` is an unused compatibility stub that `flake.nix` bypasses. ## Scope - `flake.nix` - `modules/common/nova-remote-builder.nix` - `modules/networking/nebula.nix` - `lib/auto-update-policy.nix` - `home/users/nimmo/` - `home/nimmo.nix` ## Implementation Checklist - [ ] Make `nova-remote-builder.nix` automatically declare the host's sops secret and default `sshKeyFile` based on `config.networking.hostName`. Remove the repeated 15-line boilerplate from `lena`, `vega`, `lyra`, and `chaos`. - [ ] Make `nixosConfig.nebula.overlayIp` default to `hostMap.${config.networking.hostName}` so hosts only need `nixosConfig.nebula.enable = true`. - [ ] Scope `plasma-manager.homeModules.plasma-manager` to desktop hosts in `flake.nix` (or desktop home-manager imports) rather than `sharedModules` on all hosts; update `auto-update-policy.nix` accordingly. - [ ] Refactor Home Manager modules to access `osConfig` directly, cleaning up redundant `extraSpecialArgs` in `flake.nix`. - [ ] Remove dead file `home/nimmo.nix`. ## Completion Criteria - Flake check passes on all hosts. - Rebuilding hosts is verified without regressions.
Author
Owner

Completed in PR #288 (merged to main in c8bebbf).

  • Automated Nova remote builder SOPS secret declaration and sshKeyFile default in modules/common/nova-remote-builder.nix, removing repetitive boilerplate from lena, vega, lyra, and chaos.
  • Defaulted nixosConfig.nebula.overlayIp to hostMap.${hostname} in modules/networking/nebula.nix, removing duplicate declarations from electra, lena, lyra, vega, and chaos.
  • Scoped plasma-manager in flake.nix via sharedModules for non-server hosts, while keeping home/users/nimmo/plasma.nix in standard generator shape to ensure compatibility with just plasma-capture. Updated lib/auto-update-policy.nix.
  • Created derived nixosConfig.host.isServer option and refactored Home Manager modules to access osConfig directly, cleaning up redundant extraSpecialArgs.
  • Removed dead file home/nimmo.nix.
  • Validated via nix flake check, full dry-run toplevel builds across all hosts, and full regression test suites. Automated review returned "Ready to merge".
Completed in PR #288 (merged to `main` in `c8bebbf`). - Automated Nova remote builder SOPS secret declaration and `sshKeyFile` default in `modules/common/nova-remote-builder.nix`, removing repetitive boilerplate from `lena`, `vega`, `lyra`, and `chaos`. - Defaulted `nixosConfig.nebula.overlayIp` to `hostMap.${hostname}` in `modules/networking/nebula.nix`, removing duplicate declarations from `electra`, `lena`, `lyra`, `vega`, and `chaos`. - Scoped `plasma-manager` in `flake.nix` via `sharedModules` for non-server hosts, while keeping `home/users/nimmo/plasma.nix` in standard generator shape to ensure compatibility with `just plasma-capture`. Updated `lib/auto-update-policy.nix`. - Created derived `nixosConfig.host.isServer` option and refactored Home Manager modules to access `osConfig` directly, cleaning up redundant `extraSpecialArgs`. - Removed dead file `home/nimmo.nix`. - Validated via `nix flake check`, full dry-run toplevel builds across all hosts, and full regression test suites. Automated review returned "Ready to merge".
nimmo closed this issue 2026-10-08 17:47:35 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#276
No description provided.