refactor(fleet): consolidate fleet boilerplate and refine module boundaries (#276) #288

Merged
nimmo merged 3 commits from feat/issue-276-consolidate-fleet-boilerplate into main 2026-10-08 17:47:02 +01:00
Owner

Context

Ref #276 (Milestone: Nix Idioms and Architecture Hygiene)

Consolidate DRY violations and non-idiomatic patterns across the fleet:

  1. Nova remote builder boilerplate: lena, vega, lyra, and chaos each declared identical sops.secrets."nix-remote-builder/<host>-private-key" definitions and sshKeyFile paths.
  2. Duplicate Nebula IP definitions: Every host's overlay IP was defined in hostMap in modules/networking/nebula.nix AND explicitly repeated in host configurations.
  3. Plasma Manager on headless servers: flake.nix unconditionally included 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 passed 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 was an unused compatibility stub.

Changes

  • Nova Remote Builder (modules/common/nova-remote-builder.nix):
    • Automatically declare sops.secrets."nix-remote-builder/${config.networking.hostName}-private-key" when cfg.enable is true.
    • Default sshKeyFile to the host's secret path and tighten type to lib.types.str.
    • Simplified hosts/{lena,lyra,vega}/default.nix and potential/chaos/default.nix.
    • Updated docs/nova-remote-builder.md.
  • Nebula Mesh (modules/networking/nebula.nix):
    • Default nixosConfig.nebula.overlayIp to hostMap.${hostname}.
    • Simplified hosts/{electra,lena,lyra,vega}/default.nix and potential/chaos/default.nix.
  • Plasma Manager:
    • Conditionally scope inputs.plasma-manager.homeModules.plasma-manager in flake.nix via home-manager.sharedModules = lib.optional (!config.nixosConfig.host.isServer) ....
    • Preserved standard generator shape { pkgs, ... }: in home/users/nimmo/plasma.nix so just plasma-capture remains fully compatible and non-destructive.
    • Scoped plasma-manager in lib/auto-update-policy.nix to [ "electra" "lena" ] (only desktop laptops).
  • Home Manager osConfig Direct Access & Host Options:
    • Added derived nixosConfig.host.isServer boolean option in modules/common/default-config.nix.
    • Home Manager modules (browser.nix, default.nix, desktop.nix, download-organizer.nix, git.nix, shell.nix) now read isServer, primaryUser, userEmail, and flakeRepo directly from osConfig.
    • Removed redundant extraSpecialArgs from flake.nix (now only passes { inherit inputs; }).
    • Aligned new-host template in justfiles/hosts.just.
  • Dead Code Cleanup:
    • Removed home/nimmo.nix.
    • Updated comment in users/nimmo.nix.
    • Net reduction: -42 lines across 20 files.

Validation

  • nix flake check passed cleanly (all checks passed! flake check OK, including formatting, nova-remote-builder-config, service-failure-monitor-coverage, redview-v2-production-config, and auto-update-state-machine).
  • Full dry-run toplevel system builds verified across all four registered hosts:
    • nix build .#nixosConfigurations.electra.config.system.build.toplevel --dry-run (success)
    • nix build .#nixosConfigurations.vega.config.system.build.toplevel --dry-run (success)
    • nix build .#nixosConfigurations.lyra.config.system.build.toplevel --dry-run (success)
    • nix build .#nixosConfigurations.lena.config.system.build.toplevel --dry-run (success)
  • Verified module evaluation: vega and lyra evaluate without plasma-manager, while electra and lena evaluate with it.
  • Regression test suites passed:
    • Deploy suite (tests/nixos-deploy-regressions.sh, tests/nixos-deploy-wrapper-regressions.sh).
    • Backup suite (tests/backup-restore-regressions.sh).
    • Update remediation suite (tests/nixos-pin-lifecycle-regressions.sh, tests/nixos-update-remediation-regressions.sh).
  • Note on AGENTS.md deployment evidence: live auto-update verification and a no-op follow-up run on a consumer host will be recorded before closing Issue #276.
## Context Ref #276 (Milestone: Nix Idioms and Architecture Hygiene) Consolidate DRY violations and non-idiomatic patterns across the fleet: 1. **Nova remote builder boilerplate**: `lena`, `vega`, `lyra`, and `chaos` each declared identical `sops.secrets."nix-remote-builder/<host>-private-key"` definitions and `sshKeyFile` paths. 2. **Duplicate Nebula IP definitions**: Every host's overlay IP was defined in `hostMap` in `modules/networking/nebula.nix` AND explicitly repeated in host configurations. 3. **Plasma Manager on headless servers**: `flake.nix` unconditionally included `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` passed `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` was an unused compatibility stub. ## Changes - **Nova Remote Builder (`modules/common/nova-remote-builder.nix`)**: - Automatically declare `sops.secrets."nix-remote-builder/${config.networking.hostName}-private-key"` when `cfg.enable` is true. - Default `sshKeyFile` to the host's secret path and tighten type to `lib.types.str`. - Simplified `hosts/{lena,lyra,vega}/default.nix` and `potential/chaos/default.nix`. - Updated `docs/nova-remote-builder.md`. - **Nebula Mesh (`modules/networking/nebula.nix`)**: - Default `nixosConfig.nebula.overlayIp` to `hostMap.${hostname}`. - Simplified `hosts/{electra,lena,lyra,vega}/default.nix` and `potential/chaos/default.nix`. - **Plasma Manager**: - Conditionally scope `inputs.plasma-manager.homeModules.plasma-manager` in `flake.nix` via `home-manager.sharedModules = lib.optional (!config.nixosConfig.host.isServer) ...`. - Preserved standard generator shape `{ pkgs, ... }:` in `home/users/nimmo/plasma.nix` so `just plasma-capture` remains fully compatible and non-destructive. - Scoped `plasma-manager` in `lib/auto-update-policy.nix` to `[ "electra" "lena" ]` (only desktop laptops). - **Home Manager `osConfig` Direct Access & Host Options**: - Added derived `nixosConfig.host.isServer` boolean option in `modules/common/default-config.nix`. - Home Manager modules (`browser.nix`, `default.nix`, `desktop.nix`, `download-organizer.nix`, `git.nix`, `shell.nix`) now read `isServer`, `primaryUser`, `userEmail`, and `flakeRepo` directly from `osConfig`. - Removed redundant `extraSpecialArgs` from `flake.nix` (now only passes `{ inherit inputs; }`). - Aligned new-host template in `justfiles/hosts.just`. - **Dead Code Cleanup**: - Removed `home/nimmo.nix`. - Updated comment in `users/nimmo.nix`. - Net reduction: -42 lines across 20 files. ## Validation - `nix flake check` passed cleanly (`all checks passed! flake check OK`, including `formatting`, `nova-remote-builder-config`, `service-failure-monitor-coverage`, `redview-v2-production-config`, and `auto-update-state-machine`). - Full dry-run toplevel system builds verified across all four registered hosts: - `nix build .#nixosConfigurations.electra.config.system.build.toplevel --dry-run` (success) - `nix build .#nixosConfigurations.vega.config.system.build.toplevel --dry-run` (success) - `nix build .#nixosConfigurations.lyra.config.system.build.toplevel --dry-run` (success) - `nix build .#nixosConfigurations.lena.config.system.build.toplevel --dry-run` (success) - Verified module evaluation: `vega` and `lyra` evaluate without `plasma-manager`, while `electra` and `lena` evaluate with it. - Regression test suites passed: - Deploy suite (`tests/nixos-deploy-regressions.sh`, `tests/nixos-deploy-wrapper-regressions.sh`). - Backup suite (`tests/backup-restore-regressions.sh`). - Update remediation suite (`tests/nixos-pin-lifecycle-regressions.sh`, `tests/nixos-update-remediation-regressions.sh`). - Note on AGENTS.md deployment evidence: live auto-update verification and a no-op follow-up run on a consumer host will be recorded before closing Issue #276.
refactor(fleet): consolidate fleet boilerplate and refine module boundaries (#276)
All checks were successful
AI pull-request review / review (pull_request) Successful in 8m36s
Build and Push Attic Cache / test (pull_request) Successful in 1m44s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
beec9237d9
- Automate Nova remote builder secret declaration and default sshKeyFile
  in modules/common/nova-remote-builder.nix; remove repeated boilerplate
  from lena, vega, lyra, and chaos.
- Default nixosConfig.nebula.overlayIp to hostMap.${config.networking.hostName};
  remove repeated overlayIp declarations from electra, lena, lyra, vega, and chaos.
- Scope plasma-manager module to desktop hosts in home/users/nimmo/plasma.nix
  rather than unconditional sharedModules in flake.nix; update auto-update policy.
- Access osConfig directly in Home Manager modules (browser, default, desktop,
  download-organizer, git, shell), eliminating redundant extraSpecialArgs.
- Remove obsolete home/nimmo.nix dead code and update documentation.
clankbot left a comment

Automated code review

Reviewed commit: beec9237d913482be526d9b7606062bd8d4e60f2

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

Re-checked the refactor against the checked-out tree. The mechanical consolidations hold: the module-provisioned sops.secrets."nix-remote-builder/${hostName}-private-key" in modules/common/nova-remote-builder.nix (inside lib.mkIf cfg.enable) reproduces exactly the attributes the per-host blocks removed (format binary, root/root, 0400, ../../secrets/nix-remote-builders/<host>.json), which matches flake.nix's nova-remote-builder-config assertions (flake.nix:222-227) and the files present in secrets/nix-remote-builders/ (chaos, electra, lena, lyra, vega); electra keeps its explicit declaration, which flake.nix:235 still requires. The new nebula.overlayIp default resolves through hostMap (modules/networking/nebula.nix:70-79) to the same values the hosts previously declared (vega 10.10.0.2, lyra 10.10.0.3, electra 10.10.0.20, lena 10.10.0.21, chaos 10.10.0.9), and every host that sets nixosConfig.nebula.enable = true is in hostMap, so the or (throw ...) guard is not reached. The removed extraSpecialArgs keys (isServer, primaryUser, userEmail, flakeRepo, hostName) are no longer consumed by any file under home/ (all now derive them from osConfig), the deleted home/nimmo.nix shim is referenced nowhere, inputs is still passed and is required by home/users/nimmo/plasma.nix, and nixosConfig.host.role, primaryUser, userEmail, flakeRepo all resolve (hosts set role; defaults live in modules/common/default-config.nix, imported via modules/common/base.nix:20). plasma.nix is reachable only through lib.optional (!isServer) (home/users/nimmo/default.nix:20) and only electra/lena set role = "laptop", so the narrowed plasma-manager host list in lib/auto-update-policy.nix matches the real consumers. Two actionable items remain: the unchanged just plasma-capture recipe now overwrites the file that supplies the plasma-manager import, and the auto-update scope change has no rollout evidence in the supplied material.

Blocking findings

None.

Important findings

  • just plasma-capture overwrites the file that now has to supply the plasma-manager import (home/users/nimmo/plasma.nix:11; medium confidence)
    The diff moves the inputs function parameter and imports = [ inputs.plasma-manager.homeModules.plasma-manager ]; (line 11) into home/users/nimmo/plasma.nix, and removes the corresponding home-manager.sharedModules = [ inputs.plasma-manager.homeModules.plasma-manager ]; from flake.nix. justfiles/hosts.just:302-309 is unchanged and defines plasma-capture as TARGET="$REPO_DIR/home/users/nimmo/plasma.nix" followed by nix run github:nix-community/plasma-manager > "$TARGET", i.e. it replaces the whole file with generator output. The pre-change version of that file (per the diff) had the header { pkgs, ... }:, no imports line and no inputs argument - the shape the recipe writes - and evaluated only because flake.nix supplied the homeModule.
    Impact: After this change, the same documented operator command writes a plasma.nix that no longer defines the programs.plasma module or receives inputs, so the next just plasma-capture followed by just check would fail evaluation on electra and lena (the only hosts that import plasma.nix, via home/users/nimmo/default.nix:20). The coupling is invisible from the module itself.
    Suggested fix: Make the capture non-destructive for this file: have plasma-capture write to a scratch path and merge, or keep a small stable wrapper module that declares the inputs parameter and the imports line and imports the generated file into it. Alternatively confirm the upstream generator emits both the inputs parameter and the imports line, and record that evidence in the recipe comment.

  • plasma-manager rebuild scope narrowed for vega/lyra without the rollout evidence AGENTS.md requires for auto-update changes (lib/auto-update-policy.nix:41; medium confidence)
    The plasma-manager group's hosts list was narrowed from [electra, lena, vega, lyra] to [electra, lena] and its rationale rewritten. This file's own header comment states the hosts field 'scopes which hosts rebuild for a given input', so it changes updater behaviour, not just evaluation. AGENTS.md:43 states an explicit repository rule: 'For multi-host or auto-update changes, record one genuine deployment and a no-op follow-up before closing the issue.' The supplied material contains no such deployment/no-op record, and no flake check or regression fixture validates the hosts lists (flake.nix:249 only appends rootInputs to the policy; no check script consumes it).
    Impact: The narrowing is consistent with the code (vega and lyra set role = "server", so plasma.nix is not imported for them), but the corrected scope is unverified at runtime: a mis-scoped list would only surface in a live auto-update run, where vega/lyra would either stop rebuilding on a plasma-manager bump or rebuild unnecessarily.
    Suggested fix: Record the rollout evidence AGENTS.md requires before closing the issue: one genuine auto-update (or explicit just auto-update-run-now) on a pull-only consumer host plus a subsequent no-op run, with an auto-update hold across the exercise, confirming vega/lyra still update correctly with plasma-manager removed from their rebuild scope.

Suggestions

None.

Tests and validation

  • No configured deterministic checks.

Questions

  • Does hosts/electra/default.nix need to keep declaring sops.secrets."nix-remote-builder/electra-private-key" now that the module provisions that attribute only under cfg.enable? flake.nix:235 (assert (builderKey electra "electra").mode == "0400") still requires it while asserting !electra.nixosConfig.novaRemoteBuilder.enable, so it is currently load-bearing for the check but inert at runtime; is that intentional, and should the check be relaxed if electra's builder credential is dropped?
  • Should justfiles/hosts.just:233-235 (which still emits home-manager.extraSpecialArgs = { inherit inputs; configName = "<host>"; } for new hosts) be aligned with the new minimal { inherit inputs; } shape, given no module under home/ consumes configName?

Review limitations

  • No Nix toolchain is available in this container, so nix flake check, just check, and the regression suites were not run; evaluation success is inferred from reading the sources, not from an evaluation.
  • The pull-request description and its Validation section were not supplied to me, so I cannot confirm whether deployment/no-op rollout evidence was recorded elsewhere; the finding is stated only against the material supplied here.
  • The pinned home-manager and plasma-manager sources are not in the tree, so I could not verify from supplied evidence that osConfig is bound in Home Manager module arguments, nor what nix run github:nix-community/plasma-manager emits; the finding about plasma-capture rests on the unchanged recipe and the pre-change file shape shown in the diff.
  • potential/chaos/default.nix is not registered in flake.nix (AGENTS.md:164 states potential/ hosts are excluded from flake builds and CI), so its changes are covered by no check; I only verified that its new defaults equal the values it previously declared explicitly.
  • Live fleet state (Nova's builder account, per-client key distribution, running auto-update state) is not supplied, so I cannot confirm the declarative changes match deployed state.
  • I did not evaluate electra's igpu/dgpu specialisations; I confirmed only that they inherit nixosConfig.host.role and networking.hostName unchanged, which is the basis for treating the new isServer derivation as tier-neutral.

Diff coverage

  • docs/nova-remote-builder.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • home/nimmo.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/browser.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/default.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/desktop.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/download-organizer.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/git.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/plasma.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/shell.nix: reviewed — included in a context-limited batch
  • hosts/electra/default.nix: reviewed — included in a context-limited batch
  • hosts/lena/default.nix: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • lib/auto-update-policy.nix: reviewed — included in a context-limited batch
  • modules/common/nova-remote-builder.nix: reviewed — included in a context-limited batch
  • modules/networking/nebula.nix: reviewed — included in a context-limited batch
  • potential/chaos/default.nix: reviewed — included in a context-limited batch
  • users/nimmo.nix: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 1
  • Previous automated review: none found
  • Findings: 2
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `beec9237d913482be526d9b7606062bd8d4e60f2` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment Re-checked the refactor against the checked-out tree. The mechanical consolidations hold: the module-provisioned `sops.secrets."nix-remote-builder/${hostName}-private-key"` in modules/common/nova-remote-builder.nix (inside `lib.mkIf cfg.enable`) reproduces exactly the attributes the per-host blocks removed (format binary, root/root, 0400, `../../secrets/nix-remote-builders/<host>.json`), which matches flake.nix's `nova-remote-builder-config` assertions (flake.nix:222-227) and the files present in `secrets/nix-remote-builders/` (chaos, electra, lena, lyra, vega); electra keeps its explicit declaration, which flake.nix:235 still requires. The new `nebula.overlayIp` default resolves through `hostMap` (modules/networking/nebula.nix:70-79) to the same values the hosts previously declared (vega 10.10.0.2, lyra 10.10.0.3, electra 10.10.0.20, lena 10.10.0.21, chaos 10.10.0.9), and every host that sets `nixosConfig.nebula.enable = true` is in `hostMap`, so the `or (throw ...)` guard is not reached. The removed `extraSpecialArgs` keys (`isServer`, `primaryUser`, `userEmail`, `flakeRepo`, `hostName`) are no longer consumed by any file under `home/` (all now derive them from `osConfig`), the deleted `home/nimmo.nix` shim is referenced nowhere, `inputs` is still passed and is required by `home/users/nimmo/plasma.nix`, and `nixosConfig.host.role`, `primaryUser`, `userEmail`, `flakeRepo` all resolve (hosts set `role`; defaults live in modules/common/default-config.nix, imported via modules/common/base.nix:20). `plasma.nix` is reachable only through `lib.optional (!isServer)` (home/users/nimmo/default.nix:20) and only electra/lena set `role = "laptop"`, so the narrowed plasma-manager host list in lib/auto-update-policy.nix matches the real consumers. Two actionable items remain: the unchanged `just plasma-capture` recipe now overwrites the file that supplies the plasma-manager import, and the auto-update scope change has no rollout evidence in the supplied material. ### Blocking findings None. ### Important findings - **`just plasma-capture` overwrites the file that now has to supply the plasma-manager import** (home/users/nimmo/plasma.nix:11; medium confidence) The diff moves the `inputs` function parameter and `imports = [ inputs.plasma-manager.homeModules.plasma-manager ];` (line 11) into `home/users/nimmo/plasma.nix`, and removes the corresponding `home-manager.sharedModules = [ inputs.plasma-manager.homeModules.plasma-manager ];` from flake.nix. `justfiles/hosts.just:302-309` is unchanged and defines `plasma-capture` as `TARGET="$REPO_DIR/home/users/nimmo/plasma.nix"` followed by `nix run github:nix-community/plasma-manager > "$TARGET"`, i.e. it replaces the whole file with generator output. The pre-change version of that file (per the diff) had the header `{ pkgs, ... }:`, no `imports` line and no `inputs` argument - the shape the recipe writes - and evaluated only because flake.nix supplied the homeModule. Impact: After this change, the same documented operator command writes a `plasma.nix` that no longer defines the `programs.plasma` module or receives `inputs`, so the next `just plasma-capture` followed by `just check` would fail evaluation on electra and lena (the only hosts that import `plasma.nix`, via home/users/nimmo/default.nix:20). The coupling is invisible from the module itself. Suggested fix: Make the capture non-destructive for this file: have `plasma-capture` write to a scratch path and merge, or keep a small stable wrapper module that declares the `inputs` parameter and the `imports` line and imports the generated file into it. Alternatively confirm the upstream generator emits both the `inputs` parameter and the `imports` line, and record that evidence in the recipe comment. - **plasma-manager rebuild scope narrowed for vega/lyra without the rollout evidence AGENTS.md requires for auto-update changes** (lib/auto-update-policy.nix:41; medium confidence) The `plasma-manager` group's `hosts` list was narrowed from [electra, lena, vega, lyra] to [electra, lena] and its rationale rewritten. This file's own header comment states the `hosts` field 'scopes which hosts rebuild for a given input', so it changes updater behaviour, not just evaluation. AGENTS.md:43 states an explicit repository rule: 'For multi-host or auto-update changes, record one genuine deployment and a no-op follow-up before closing the issue.' The supplied material contains no such deployment/no-op record, and no flake check or regression fixture validates the `hosts` lists (flake.nix:249 only appends `rootInputs` to the policy; no check script consumes it). Impact: The narrowing is consistent with the code (vega and lyra set `role = "server"`, so `plasma.nix` is not imported for them), but the corrected scope is unverified at runtime: a mis-scoped list would only surface in a live auto-update run, where vega/lyra would either stop rebuilding on a plasma-manager bump or rebuild unnecessarily. Suggested fix: Record the rollout evidence AGENTS.md requires before closing the issue: one genuine auto-update (or explicit `just auto-update-run-now`) on a pull-only consumer host plus a subsequent no-op run, with an auto-update hold across the exercise, confirming vega/lyra still update correctly with plasma-manager removed from their rebuild scope. ### Suggestions None. ### Tests and validation - No configured deterministic checks. ### Questions - Does `hosts/electra/default.nix` need to keep declaring `sops.secrets."nix-remote-builder/electra-private-key"` now that the module provisions that attribute only under `cfg.enable`? flake.nix:235 (`assert (builderKey electra "electra").mode == "0400"`) still requires it while asserting `!electra.nixosConfig.novaRemoteBuilder.enable`, so it is currently load-bearing for the check but inert at runtime; is that intentional, and should the check be relaxed if electra's builder credential is dropped? - Should `justfiles/hosts.just:233-235` (which still emits `home-manager.extraSpecialArgs = { inherit inputs; configName = "<host>"; }` for new hosts) be aligned with the new minimal `{ inherit inputs; }` shape, given no module under `home/` consumes `configName`? ### Review limitations - No Nix toolchain is available in this container, so `nix flake check`, `just check`, and the regression suites were not run; evaluation success is inferred from reading the sources, not from an evaluation. - The pull-request description and its Validation section were not supplied to me, so I cannot confirm whether deployment/no-op rollout evidence was recorded elsewhere; the finding is stated only against the material supplied here. - The pinned home-manager and plasma-manager sources are not in the tree, so I could not verify from supplied evidence that `osConfig` is bound in Home Manager module arguments, nor what `nix run github:nix-community/plasma-manager` emits; the finding about `plasma-capture` rests on the unchanged recipe and the pre-change file shape shown in the diff. - `potential/chaos/default.nix` is not registered in flake.nix (AGENTS.md:164 states `potential/` hosts are excluded from flake builds and CI), so its changes are covered by no check; I only verified that its new defaults equal the values it previously declared explicitly. - Live fleet state (Nova's builder account, per-client key distribution, running auto-update state) is not supplied, so I cannot confirm the declarative changes match deployed state. - I did not evaluate electra's `igpu`/`dgpu` specialisations; I confirmed only that they inherit `nixosConfig.host.role` and `networking.hostName` unchanged, which is the basis for treating the new `isServer` derivation as tier-neutral. ### Diff coverage - `docs/nova-remote-builder.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `home/nimmo.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/browser.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/default.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/desktop.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/download-organizer.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/git.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/plasma.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/shell.nix`: **reviewed** — included in a context-limited batch - `hosts/electra/default.nix`: **reviewed** — included in a context-limited batch - `hosts/lena/default.nix`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `lib/auto-update-policy.nix`: **reviewed** — included in a context-limited batch - `modules/common/nova-remote-builder.nix`: **reviewed** — included in a context-limited batch - `modules/networking/nebula.nix`: **reviewed** — included in a context-limited batch - `potential/chaos/default.nix`: **reviewed** — included in a context-limited batch - `users/nimmo.nix`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 1 - Previous automated review: none found - Findings: 2 </details>
fix(plasma): scope plasma-manager in flake.nix to preserve plasma-capture compatibility
All checks were successful
AI pull-request review / review (pull_request) Successful in 10m53s
Build and Push Attic Cache / test (pull_request) Successful in 1m40s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
9938669c71
- Scope inputs.plasma-manager.homeModules.plasma-manager in flake.nix
  via home-manager.sharedModules for desktop hosts (role != server).
- Revert home/users/nimmo/plasma.nix to standard generator shape
  to prevent just plasma-capture from overwriting the module import.
- Align new-host template extraSpecialArgs in justfiles/hosts.just.
clankbot left a comment

Automated code review

Reviewed commit: 9938669c71b586aa922634324d9a5018c237e446

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The refactor is internally consistent on the evidence available. Nebula: the new overlayIp default in modules/networking/nebula.nix:71-76 resolves through hostMap (vega 10.10.0.2, lyra 10.10.0.3, lena 10.10.0.21, electra 10.10.0.20, chaos 10.10.0.9), which matches every overlayIp removed from the host files, so no registered or potential host changes value. Nova: the module's auto-declared sops.secrets."nix-remote-builder/<host>-private-key" (modules/common/nova-remote-builder.nix:77-83) is identical in sopsFile/format/owner/group/mode to the declarations removed from lena, lyra, vega and chaos, ../../secrets/... resolves to the same repository paths from modules/common/ (all five files exist under secrets/nix-remote-builders/), and the nova-remote-builder-config check's key assertions still hold; electra keeps its own copy at hosts/electra/default.nix:147 and does not enable the builder, so the mkIf cfg.enable guard does not collide with it. Home Manager: the only consumers of the removed specialArgs are the five home/users/nimmo modules, all of which now derive the same values from osConfig.nixosConfig.*, and modules/common/default-config.nix supplies identical defaults; home/nimmo.nix has no remaining importer (flake.nix imports ./home/users/), and the role == "server" guards in flake.nix and home/users/nimmo/default.nix:20 agree, so vega/lyra lose both the plasma-manager home module and plasma.nix consistently (programs.plasma is set only in plasma.nix). Remaining items are a validation-evidence gap mandated by AGENTS.md and two change-introduced fragility/dead-guard issues; no evaluation defect was demonstrated in the supplied files.

Blocking findings

None.

Important findings

  • Multi-host plus auto-update policy narrowing has no recorded deployment or test-activation evidence (lib/auto-update-policy.nix:41; medium confidence)
    The change narrows the plasma-manager group's hosts from electra/lena/vega/lyra to electra/lena (lib/auto-update-policy.nix:39-45) and makes flake.nix:146-148 drop inputs.plasma-manager.homeModules.plasma-manager from home-manager.sharedModules for role == "server" hosts, i.e. it touches all four registered nixosConfigurations (flake.nix:259-273). AGENTS.md:43 states an explicit repository rule: 'For multi-host or auto-update changes, record one genuine deployment and a no-op follow-up before closing the issue', and AGENTS.md:45 'Use just test rather than raw nixos-rebuild test'. The supplied material contains no record of a test activation, genuine deployment, or no-op follow-up for vega or lyra.
    Impact: Deterministic evaluation of the servers' home-manager configuration (plasma-manager removed, plasma.nix not imported, manual.* disabled) is not exercised by anything in the supplied evidence; a latent activation or updater regression on the two headless servers would remain unverified against the repository's own merge gate.
    Suggested fix: Before closing the issue, satisfy AGENTS.md:43/45: create an auto-update hold, run just test on one headless host (vega or lyra) and one desktop host (electra or lena), record a no-op follow-up, and release the hold only after validation.

Suggestions

  • The desktop/server decision is now re-derived as a raw role == "server" predicate in six places (flake.nix:146; medium confidence)
    The change introduces the same predicate independently at flake.nix:146 (config.nixosConfig.host.role != "server" guarding the plasma-manager home module), home/users/nimmo/default.nix:8 (guarding ./plasma.nix at line 20), browser.nix:11, desktop.nix:10 and download-organizer.nix:9, while lib/auto-update-policy.nix:41-43 encodes the same host set as literal names. nixosConfig.host.role is an enum with default = "unspecified" (modules/common/default-config.nix:56-65) and scripts/new-host-template.nix:29 emits role = "unspecified", so the guard is an exclusion, not an opt-in.
    Impact: The two coupled copies must stay in lock-step: if flake.nix and home/users/nimmo/default.nix ever disagree, a server either receives programs.plasma options with no plasma-manager home module (unknown-option evaluation error) or a desktop loses the module while keeping plasma.nix. Nothing in the repository keeps lib/auto-update-policy.nix's host names aligned with either guard.
    Suggested fix: Derive the decision once, e.g. a boolean option in modules/common/default-config.nix computed from role (or from services.desktopManager.plasma6.enable), and have flake.nix, the home modules and the new-host template read that single option; keep the auto-update policy host list consistent with it.

  • New sshKeyFile default makes the option's null case and its assertion unreachable by default (modules/common/nova-remote-builder.nix:49; medium confidence)
    sshKeyFile keeps type = lib.types.nullOr lib.types.str (line 48) but its default is now config.sops.secrets."nix-remote-builder/${config.networking.hostName}-private-key".path (line 49), which yields a string or fails; the guard assertion = cfg.sshKeyFile != null (line 72) can therefore only fire for an explicit sshKeyFile = null override, not for the default. The secret itself is declared only under lib.mkIf cfg.enable (lines 77-83), so a host that enables the builder without secrets/nix-remote-builders/<host>.json fails while resolving the default (the relative path literal in line 78 does not exist) instead of reaching the diagnostic message at line 73.
    Impact: No current host is in that state (chaos/electra/lena/lyra/vega json files all exist), so this is not a demonstrated defect; but the nullOr type and the assertion are now effectively dead for the default path, and a mis-provisioned future host surfaces as a raw path/attribute evaluation error rather than the intended message.
    Suggested fix: Pick one contract: either tighten the type to lib.types.str and drop the now-unreachable null assertion, or keep a meaningful guard (default null, resolve the sops path inside the mkIf cfg.enable block, retain the assertion). The flake check's builder.sshKey == key.path assertion (flake.nix:235) remains the deterministic gate either way.

Tests and validation

  • No configured deterministic checks.

Questions

  • Was a genuine deployment plus a no-op follow-up recorded on a headless host (vega or lyra) for this multi-host and auto-update-policy change, as AGENTS.md:43 requires before closing the issue?
  • Does the pinned nixos-auto-update package accept a host being absent from a group's hosts list (i.e. treat it as 'do not rebuild' rather than an error), for the pull-only consumers vega and lyra? The package source is not in this repository.
  • Electra still declares sops.secrets."nix-remote-builder/electra-private-key" itself (hosts/electra/default.nix:147) while the module now declares the same key name under mkIf cfg.enable. If Electra ever sets nixosConfig.novaRemoteBuilder.enable = true, should that hand-written declaration be removed to avoid a duplicate sops.secrets definition?
  • Should scripts/new-host-template.nix emit an explicit role (rather than "unspecified") now that desktop behaviour is gated on role != "server" in flake.nix and the home modules?

Review limitations

  • No Nix tooling was available: I did not evaluate the flake, run nix flake check, or execute any test; the PR's reported check and regression-suite results were not supplied to me and are treated as unverified.
  • The nixos-auto-update flake/module/package is an external input; I could not inspect how it consumes lib/auto-update-policy.nix hosts entries or pinned groups.
  • Home Manager's provision of osConfig to home modules and submodules is inferred from the checked-out integration (hmFlake.nixosModules.home-manager plus home-manager.users.* at flake.nix:149); the home-manager source was not supplied.
  • No live host state was inspected: SOPS decryption and age recipient coverage, .sops.yaml recipient sets, Nebula mesh runtime, /run/secrets/... paths, and actual service activation on vega/lyra remain unverified.
  • The pull-request description and its Validation section were not part of the supplied material; the absence of deployment evidence is stated only with respect to what was supplied.
  • I did not inspect flake.lock, .forgejo/workflows/attic-cache.yml, or the upstream home-manager/plasma-manager sources for option-name compatibility.

Diff coverage

  • docs/nova-remote-builder.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • home/nimmo.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/browser.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/default.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/desktop.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/download-organizer.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/git.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/shell.nix: reviewed — included in a context-limited batch
  • hosts/electra/default.nix: reviewed — included in a context-limited batch
  • hosts/lena/default.nix: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • justfiles/hosts.just: reviewed — included in a context-limited batch
  • lib/auto-update-policy.nix: reviewed — included in a context-limited batch
  • modules/common/nova-remote-builder.nix: reviewed — included in a context-limited batch
  • modules/networking/nebula.nix: reviewed — included in a context-limited batch
  • potential/chaos/default.nix: reviewed — included in a context-limited batch
  • users/nimmo.nix: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 2
  • Previous automated review: none found
  • Findings: 3
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `9938669c71b586aa922634324d9a5018c237e446` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The refactor is internally consistent on the evidence available. Nebula: the new `overlayIp` default in modules/networking/nebula.nix:71-76 resolves through `hostMap` (vega 10.10.0.2, lyra 10.10.0.3, lena 10.10.0.21, electra 10.10.0.20, chaos 10.10.0.9), which matches every `overlayIp` removed from the host files, so no registered or potential host changes value. Nova: the module's auto-declared `sops.secrets."nix-remote-builder/<host>-private-key"` (modules/common/nova-remote-builder.nix:77-83) is identical in sopsFile/format/owner/group/mode to the declarations removed from lena, lyra, vega and chaos, `../../secrets/...` resolves to the same repository paths from modules/common/ (all five files exist under secrets/nix-remote-builders/), and the `nova-remote-builder-config` check's key assertions still hold; electra keeps its own copy at hosts/electra/default.nix:147 and does not enable the builder, so the `mkIf cfg.enable` guard does not collide with it. Home Manager: the only consumers of the removed specialArgs are the five home/users/nimmo modules, all of which now derive the same values from `osConfig.nixosConfig.*`, and modules/common/default-config.nix supplies identical defaults; `home/nimmo.nix` has no remaining importer (flake.nix imports ./home/users/<primaryUser>), and the `role == "server"` guards in flake.nix and home/users/nimmo/default.nix:20 agree, so vega/lyra lose both the plasma-manager home module and plasma.nix consistently (programs.plasma is set only in plasma.nix). Remaining items are a validation-evidence gap mandated by AGENTS.md and two change-introduced fragility/dead-guard issues; no evaluation defect was demonstrated in the supplied files. ### Blocking findings None. ### Important findings - **Multi-host plus auto-update policy narrowing has no recorded deployment or test-activation evidence** (lib/auto-update-policy.nix:41; medium confidence) The change narrows the plasma-manager group's `hosts` from electra/lena/vega/lyra to electra/lena (lib/auto-update-policy.nix:39-45) and makes flake.nix:146-148 drop `inputs.plasma-manager.homeModules.plasma-manager` from `home-manager.sharedModules` for `role == "server"` hosts, i.e. it touches all four registered nixosConfigurations (flake.nix:259-273). AGENTS.md:43 states an explicit repository rule: 'For multi-host or auto-update changes, record one genuine deployment and a no-op follow-up before closing the issue', and AGENTS.md:45 'Use `just test` rather than raw `nixos-rebuild test`'. The supplied material contains no record of a test activation, genuine deployment, or no-op follow-up for vega or lyra. Impact: Deterministic evaluation of the servers' home-manager configuration (plasma-manager removed, plasma.nix not imported, manual.* disabled) is not exercised by anything in the supplied evidence; a latent activation or updater regression on the two headless servers would remain unverified against the repository's own merge gate. Suggested fix: Before closing the issue, satisfy AGENTS.md:43/45: create an auto-update hold, run `just test` on one headless host (vega or lyra) and one desktop host (electra or lena), record a no-op follow-up, and release the hold only after validation. ### Suggestions - **The desktop/server decision is now re-derived as a raw `role == "server"` predicate in six places** (flake.nix:146; medium confidence) The change introduces the same predicate independently at flake.nix:146 (`config.nixosConfig.host.role != "server"` guarding the plasma-manager home module), home/users/nimmo/default.nix:8 (guarding `./plasma.nix` at line 20), browser.nix:11, desktop.nix:10 and download-organizer.nix:9, while lib/auto-update-policy.nix:41-43 encodes the same host set as literal names. `nixosConfig.host.role` is an enum with `default = "unspecified"` (modules/common/default-config.nix:56-65) and scripts/new-host-template.nix:29 emits `role = "unspecified"`, so the guard is an exclusion, not an opt-in. Impact: The two coupled copies must stay in lock-step: if flake.nix and home/users/nimmo/default.nix ever disagree, a server either receives `programs.plasma` options with no plasma-manager home module (unknown-option evaluation error) or a desktop loses the module while keeping plasma.nix. Nothing in the repository keeps lib/auto-update-policy.nix's host names aligned with either guard. Suggested fix: Derive the decision once, e.g. a boolean option in modules/common/default-config.nix computed from `role` (or from `services.desktopManager.plasma6.enable`), and have flake.nix, the home modules and the new-host template read that single option; keep the auto-update policy host list consistent with it. - **New sshKeyFile default makes the option's null case and its assertion unreachable by default** (modules/common/nova-remote-builder.nix:49; medium confidence) `sshKeyFile` keeps `type = lib.types.nullOr lib.types.str` (line 48) but its default is now `config.sops.secrets."nix-remote-builder/${config.networking.hostName}-private-key".path` (line 49), which yields a string or fails; the guard `assertion = cfg.sshKeyFile != null` (line 72) can therefore only fire for an explicit `sshKeyFile = null` override, not for the default. The secret itself is declared only under `lib.mkIf cfg.enable` (lines 77-83), so a host that enables the builder without `secrets/nix-remote-builders/<host>.json` fails while resolving the default (the relative path literal in line 78 does not exist) instead of reaching the diagnostic message at line 73. Impact: No current host is in that state (chaos/electra/lena/lyra/vega json files all exist), so this is not a demonstrated defect; but the `nullOr` type and the assertion are now effectively dead for the default path, and a mis-provisioned future host surfaces as a raw path/attribute evaluation error rather than the intended message. Suggested fix: Pick one contract: either tighten the type to `lib.types.str` and drop the now-unreachable null assertion, or keep a meaningful guard (default `null`, resolve the sops path inside the `mkIf cfg.enable` block, retain the assertion). The flake check's `builder.sshKey == key.path` assertion (flake.nix:235) remains the deterministic gate either way. ### Tests and validation - No configured deterministic checks. ### Questions - Was a genuine deployment plus a no-op follow-up recorded on a headless host (vega or lyra) for this multi-host and auto-update-policy change, as AGENTS.md:43 requires before closing the issue? - Does the pinned `nixos-auto-update` package accept a host being absent from a group's `hosts` list (i.e. treat it as 'do not rebuild' rather than an error), for the pull-only consumers vega and lyra? The package source is not in this repository. - Electra still declares `sops.secrets."nix-remote-builder/electra-private-key"` itself (hosts/electra/default.nix:147) while the module now declares the same key name under `mkIf cfg.enable`. If Electra ever sets `nixosConfig.novaRemoteBuilder.enable = true`, should that hand-written declaration be removed to avoid a duplicate sops.secrets definition? - Should `scripts/new-host-template.nix` emit an explicit `role` (rather than `"unspecified"`) now that desktop behaviour is gated on `role != "server"` in flake.nix and the home modules? ### Review limitations - No Nix tooling was available: I did not evaluate the flake, run `nix flake check`, or execute any test; the PR's reported check and regression-suite results were not supplied to me and are treated as unverified. - The `nixos-auto-update` flake/module/package is an external input; I could not inspect how it consumes `lib/auto-update-policy.nix` `hosts` entries or `pinned` groups. - Home Manager's provision of `osConfig` to home modules and submodules is inferred from the checked-out integration (`hmFlake.nixosModules.home-manager` plus `home-manager.users.*` at flake.nix:149); the home-manager source was not supplied. - No live host state was inspected: SOPS decryption and age recipient coverage, `.sops.yaml` recipient sets, Nebula mesh runtime, `/run/secrets/...` paths, and actual service activation on vega/lyra remain unverified. - The pull-request description and its Validation section were not part of the supplied material; the absence of deployment evidence is stated only with respect to what was supplied. - I did not inspect `flake.lock`, `.forgejo/workflows/attic-cache.yml`, or the upstream `home-manager`/`plasma-manager` sources for option-name compatibility. ### Diff coverage - `docs/nova-remote-builder.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `home/nimmo.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/browser.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/default.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/desktop.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/download-organizer.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/git.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/shell.nix`: **reviewed** — included in a context-limited batch - `hosts/electra/default.nix`: **reviewed** — included in a context-limited batch - `hosts/lena/default.nix`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `justfiles/hosts.just`: **reviewed** — included in a context-limited batch - `lib/auto-update-policy.nix`: **reviewed** — included in a context-limited batch - `modules/common/nova-remote-builder.nix`: **reviewed** — included in a context-limited batch - `modules/networking/nebula.nix`: **reviewed** — included in a context-limited batch - `potential/chaos/default.nix`: **reviewed** — included in a context-limited batch - `users/nimmo.nix`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 2 - Previous automated review: none found - Findings: 3 </details>
refactor(common): unify isServer option and tighten novaRemoteBuilder sshKeyFile
All checks were successful
AI pull-request review / review (pull_request) Successful in 10m56s
Build and Push Attic Cache / test (pull_request) Successful in 1m27s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
458f10e9a0
- Add derived nixosConfig.host.isServer option in modules/common/default-config.nix.
- Consume nixosConfig.host.isServer across flake.nix and home modules.
- Tighten sshKeyFile type to string and remove redundant null assertion in nova-remote-builder.
clankbot left a comment

Automated code review

Reviewed commit: 458f10e9a0c1400fdb9a5e1c697781cd497a0bb8

Verdict: Ready to merge

No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.

Overall assessment

The refactor is internally consistent for the four registered hosts. I traced each new indirection: nixosConfig.host.isServer (modules/common/default-config.nix:68-72) defaults to role == "server", which reproduces the value flake.nix previously passed as extraSpecialArgs.isServer, so the !isServer gates in home/users/nimmo/{default,desktop,browser,download-organizer}.nix keep their prior behaviour; osConfig is supplied by the NixOS-integrated home-manager.users.<user> path (flake.nix:149), and home/users/nimmo has no other importer (only flake.nix:149), so deleting home/nimmo.nix leaves no dangling import and no home module still reads isServer/primaryUser/userEmail/flakeRepo/hostName as a function argument. The derived nebula.overlayIp (modules/networking/nebula.nix:71-73) resolves through hostMap to the exact values removed from the host files (vega 10.10.0.2, lyra 10.10.0.3, electra 10.10.0.20, lena 10.10.0.21, chaos 10.10.0.9), so no overlay IP drifts. The auto-declared sops.secrets."nix-remote-builder/<host>-private-key" matches the flake.nix:204-235 nova-remote-builder-config assertions (sopsFile, format, owner, group, mode == "0400", sshKey == key.path), and Electra, which the check asserts is not enabled, keeps its own declaration at hosts/electra/default.nix:147-153, so no duplicate submodule definition is introduced. Remaining findings are coupling/maintenance risks introduced by the change, not evaluation failures.

Blocking findings

None.

Important findings

None.

Suggestions

  • Nova builder SOPS secret is now declared from enable alone, decoupled from sshKeyFile (modules/common/nova-remote-builder.nix:70; medium confidence)
    The lib.mkIf cfg.enable block (line 69-76) declares sops.secrets."nix-remote-builder/${config.networking.hostName}-private-key" with sopsFile = ../../secrets/nix-remote-builders/${config.networking.hostName}.json, while sshKeyFile (line 47-55) is a separate option whose default merely points at that attribute. The previous assertions entry naming the missing credential was removed in the same hunk. .sops.yaml grants path_regex entries only for lyra, electra, vega, chaos and lena (lines 97-136), and those are exactly the files under secrets/nix-remote-builders/.
    Impact: Two behaviour changes for any future opt-in: (1) a host setting enable = true without a pre-existing secrets/nix-remote-builders/<host>.json now fails on an unresolvable Nix path literal instead of the explicit message that was deleted; (2) a host that overrides sshKeyFile still requires and installs the derived secret even though nothing consumes it, exposing a builder credential unnecessarily. No current host is affected (lena/vega/lyra use the default; electra and chaos do not enable the module).
    Suggested fix: Keep the derived default, but either gate the sops.secrets declaration on the default actually being used, or restore a diagnostic assertion naming the required secrets/nix-remote-builders/<host>.json and its .sops.yaml recipient entry so a new opt-in fails with an actionable message. docs/nova-remote-builder.md:186-188 currently states only that the key is provisioned automatically, without the paired .sops.yaml recipient requirement.

  • plasma-manager policy hosts list is now hand-maintained while the real consumer set became a predicate (lib/auto-update-policy.nix:41; medium confidence)
    The group's hosts list is reduced to [ "electra" "lena" ] and its rationale changed to "Consumed only by desktop hosts". The actual consumer set is now computed: flake.nix:145-147 adds inputs.plasma-manager.homeModules.plasma-manager under !config.nixosConfig.host.isServer, and home/users/nimmo/default.nix:20 imports ./plasma.nix under the same predicate, where isServer is role == "server" over an enum that also admits desktop, workstation and unspecified (modules/common/default-config.nix:52-63). The file's own header states that hosts scopes which hosts rebuild for an input, and README.md:89 requires inputs to be classified by real consumers.
    Impact: Today the two agree (electra/lena are role = "laptop", vega/lyra are "server"), so no current host is mis-scoped. A future registered non-server host, or a role change on an existing host, would silently consume plasma-manager while being excluded from this group, so a plasma-manager lock update would not rebuild or validate that host.
    Suggested fix: Derive the consumer list from the evaluated configurations (flake.nix:252-255 already derives rootInputs from the real input set), or state in the group rationale that the list must be updated in the same change that adds or re-roles any non-server host.

  • isServer is a writable option duplicating the role predicate still used elsewhere (modules/common/default-config.nix:68; medium confidence)
    The new option is a writable lib.types.bool whose default is config.nixosConfig.host.role == "server". modules/server/base.nix:17 still derives the same decision inline: documentation.nixos.enable = lib.mkIf (config.nixosConfig.host.role == "server") false;. The new option is consumed by flake.nix:146 and by home/users/nimmo/{default,desktop,browser,download-organizer}.nix. AGENTS.md:143 documents nixosConfig.host as holding role, purpose, location, tags, and does not mention isServer.
    Impact: Because the option is writable, a host may set nixosConfig.host.isServer independently of role, so system-side behaviour gated on role (modules/server/base.nix) and Home Manager / plasma-manager scoping gated on isServer could then disagree. No current host sets isServer, so this is a divergence risk rather than an observed defect.
    Suggested fix: Mark the derived option readOnly = true (or express it as a plain derived value) so it cannot diverge from role, and switch modules/server/base.nix:17 to consume config.nixosConfig.host.isServer so only one predicate remains; document the derived field if it stays part of nixosConfig.host.

Tests and validation

  • No configured deterministic checks.

Questions

  • potential/chaos/default.nix keeps nixosConfig.novaRemoteBuilder.enable = true and nixosConfig.nebula.enable = true; the module now auto-declares secrets/nix-remote-builders/chaos.json for it. Is keeping that unregistered draft enabled intentional, or should the draft drop the explicit enable now that the credential is implied by it?
  • When Nova's NixOS draft is registered, which nixosConfig.host.role will it carry? Both the plasma-manager scoping (flake.nix:146) and modules/server/base.nix:17 now key off that role, so the choice decides whether it receives desktop Home Manager configuration.
  • Should modules/server/base.nix:17 be migrated to the new isServer option as part of this refactor, or deliberately left on role?

Review limitations

  • No Nix tooling was available in this review container: I performed no evaluation, build, or nix flake check, so the claim that the four toplevel builds and the checks pass is taken from the pull-request text, not verified here.
  • I did not inspect flake.lock, .forgejo/workflows/attic-cache.yml runtime behaviour, or the pinned nixos-auto-update package implementation, so the meaning of hosts in lib/auto-update-policy.nix is taken only from that file's header and README.md:89.
  • home/users/nimmo/plasma.nix, modules/server/base.nix, scripts/new-host-template.nix, hosts/electra/default.nix's retained nix-remote-builder/electra-private-key block, and .sops.yaml were read only to check the changed code against them; I did not assess them for independent defects, and they are not in the changed-file set.
  • The regression suites named in the pull-request text were not executed; I confirmed only that none of them reference overlayIp, sshKeyFile, novaRemoteBuilder, or plasma.
  • The add-host recipe in justfiles/hosts.just still prints a registration block that omits the conditional home-manager.sharedModules; that omission is present both before and after this change, so I did not report it as a defect caused by the supplied diff.

Diff coverage

  • docs/nova-remote-builder.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • home/nimmo.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/browser.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/default.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/desktop.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/download-organizer.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/git.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/shell.nix: reviewed — included in a context-limited batch
  • hosts/electra/default.nix: reviewed — included in a context-limited batch
  • hosts/lena/default.nix: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • justfiles/hosts.just: reviewed — included in a context-limited batch
  • lib/auto-update-policy.nix: reviewed — included in a context-limited batch
  • modules/common/default-config.nix: reviewed — included in a context-limited batch
  • modules/common/nova-remote-builder.nix: reviewed — included in a context-limited batch
  • modules/networking/nebula.nix: reviewed — included in a context-limited batch
  • potential/chaos/default.nix: reviewed — included in a context-limited batch
  • users/nimmo.nix: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 3
  • Previous automated review: none found
  • Findings: 3
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `458f10e9a0c1400fdb9a5e1c697781cd497a0bb8` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment The refactor is internally consistent for the four registered hosts. I traced each new indirection: `nixosConfig.host.isServer` (modules/common/default-config.nix:68-72) defaults to `role == "server"`, which reproduces the value flake.nix previously passed as `extraSpecialArgs.isServer`, so the `!isServer` gates in home/users/nimmo/{default,desktop,browser,download-organizer}.nix keep their prior behaviour; `osConfig` is supplied by the NixOS-integrated `home-manager.users.<user>` path (flake.nix:149), and `home/users/nimmo` has no other importer (only flake.nix:149), so deleting `home/nimmo.nix` leaves no dangling import and no home module still reads `isServer`/`primaryUser`/`userEmail`/`flakeRepo`/`hostName` as a function argument. The derived `nebula.overlayIp` (modules/networking/nebula.nix:71-73) resolves through `hostMap` to the exact values removed from the host files (vega 10.10.0.2, lyra 10.10.0.3, electra 10.10.0.20, lena 10.10.0.21, chaos 10.10.0.9), so no overlay IP drifts. The auto-declared `sops.secrets."nix-remote-builder/<host>-private-key"` matches the `flake.nix:204-235` `nova-remote-builder-config` assertions (`sopsFile`, `format`, `owner`, `group`, `mode == "0400"`, `sshKey == key.path`), and Electra, which the check asserts is not enabled, keeps its own declaration at hosts/electra/default.nix:147-153, so no duplicate submodule definition is introduced. Remaining findings are coupling/maintenance risks introduced by the change, not evaluation failures. ### Blocking findings None. ### Important findings None. ### Suggestions - **Nova builder SOPS secret is now declared from `enable` alone, decoupled from `sshKeyFile`** (modules/common/nova-remote-builder.nix:70; medium confidence) The `lib.mkIf cfg.enable` block (line 69-76) declares `sops.secrets."nix-remote-builder/${config.networking.hostName}-private-key"` with `sopsFile = ../../secrets/nix-remote-builders/${config.networking.hostName}.json`, while `sshKeyFile` (line 47-55) is a separate option whose default merely points at that attribute. The previous `assertions` entry naming the missing credential was removed in the same hunk. `.sops.yaml` grants path_regex entries only for lyra, electra, vega, chaos and lena (lines 97-136), and those are exactly the files under `secrets/nix-remote-builders/`. Impact: Two behaviour changes for any future opt-in: (1) a host setting `enable = true` without a pre-existing `secrets/nix-remote-builders/<host>.json` now fails on an unresolvable Nix path literal instead of the explicit message that was deleted; (2) a host that overrides `sshKeyFile` still requires and installs the derived secret even though nothing consumes it, exposing a builder credential unnecessarily. No current host is affected (lena/vega/lyra use the default; electra and chaos do not enable the module). Suggested fix: Keep the derived default, but either gate the `sops.secrets` declaration on the default actually being used, or restore a diagnostic assertion naming the required `secrets/nix-remote-builders/<host>.json` and its `.sops.yaml` recipient entry so a new opt-in fails with an actionable message. docs/nova-remote-builder.md:186-188 currently states only that the key is provisioned automatically, without the paired `.sops.yaml` recipient requirement. - **plasma-manager policy `hosts` list is now hand-maintained while the real consumer set became a predicate** (lib/auto-update-policy.nix:41; medium confidence) The group's `hosts` list is reduced to `[ "electra" "lena" ]` and its rationale changed to "Consumed only by desktop hosts". The actual consumer set is now computed: flake.nix:145-147 adds `inputs.plasma-manager.homeModules.plasma-manager` under `!config.nixosConfig.host.isServer`, and home/users/nimmo/default.nix:20 imports `./plasma.nix` under the same predicate, where `isServer` is `role == "server"` over an enum that also admits `desktop`, `workstation` and `unspecified` (modules/common/default-config.nix:52-63). The file's own header states that `hosts` scopes which hosts rebuild for an input, and README.md:89 requires inputs to be classified by real consumers. Impact: Today the two agree (electra/lena are `role = "laptop"`, vega/lyra are `"server"`), so no current host is mis-scoped. A future registered non-`server` host, or a role change on an existing host, would silently consume plasma-manager while being excluded from this group, so a plasma-manager lock update would not rebuild or validate that host. Suggested fix: Derive the consumer list from the evaluated configurations (flake.nix:252-255 already derives `rootInputs` from the real input set), or state in the group rationale that the list must be updated in the same change that adds or re-roles any non-server host. - **`isServer` is a writable option duplicating the `role` predicate still used elsewhere** (modules/common/default-config.nix:68; medium confidence) The new option is a writable `lib.types.bool` whose default is `config.nixosConfig.host.role == "server"`. `modules/server/base.nix:17` still derives the same decision inline: `documentation.nixos.enable = lib.mkIf (config.nixosConfig.host.role == "server") false;`. The new option is consumed by flake.nix:146 and by home/users/nimmo/{default,desktop,browser,download-organizer}.nix. AGENTS.md:143 documents `nixosConfig.host` as holding `role`, `purpose`, `location`, `tags`, and does not mention `isServer`. Impact: Because the option is writable, a host may set `nixosConfig.host.isServer` independently of `role`, so system-side behaviour gated on `role` (modules/server/base.nix) and Home Manager / plasma-manager scoping gated on `isServer` could then disagree. No current host sets `isServer`, so this is a divergence risk rather than an observed defect. Suggested fix: Mark the derived option `readOnly = true` (or express it as a plain derived value) so it cannot diverge from `role`, and switch `modules/server/base.nix:17` to consume `config.nixosConfig.host.isServer` so only one predicate remains; document the derived field if it stays part of `nixosConfig.host`. ### Tests and validation - No configured deterministic checks. ### Questions - potential/chaos/default.nix keeps `nixosConfig.novaRemoteBuilder.enable = true` and `nixosConfig.nebula.enable = true`; the module now auto-declares `secrets/nix-remote-builders/chaos.json` for it. Is keeping that unregistered draft enabled intentional, or should the draft drop the explicit `enable` now that the credential is implied by it? - When Nova's NixOS draft is registered, which `nixosConfig.host.role` will it carry? Both the plasma-manager scoping (flake.nix:146) and `modules/server/base.nix:17` now key off that role, so the choice decides whether it receives desktop Home Manager configuration. - Should `modules/server/base.nix:17` be migrated to the new `isServer` option as part of this refactor, or deliberately left on `role`? ### Review limitations - No Nix tooling was available in this review container: I performed no evaluation, build, or `nix flake check`, so the claim that the four toplevel builds and the checks pass is taken from the pull-request text, not verified here. - I did not inspect `flake.lock`, `.forgejo/workflows/attic-cache.yml` runtime behaviour, or the pinned `nixos-auto-update` package implementation, so the meaning of `hosts` in lib/auto-update-policy.nix is taken only from that file's header and README.md:89. - `home/users/nimmo/plasma.nix`, `modules/server/base.nix`, `scripts/new-host-template.nix`, `hosts/electra/default.nix`'s retained `nix-remote-builder/electra-private-key` block, and `.sops.yaml` were read only to check the changed code against them; I did not assess them for independent defects, and they are not in the changed-file set. - The regression suites named in the pull-request text were not executed; I confirmed only that none of them reference `overlayIp`, `sshKeyFile`, `novaRemoteBuilder`, or `plasma`. - The `add-host` recipe in justfiles/hosts.just still prints a registration block that omits the conditional `home-manager.sharedModules`; that omission is present both before and after this change, so I did not report it as a defect caused by the supplied diff. ### Diff coverage - `docs/nova-remote-builder.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `home/nimmo.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/browser.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/default.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/desktop.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/download-organizer.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/git.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/shell.nix`: **reviewed** — included in a context-limited batch - `hosts/electra/default.nix`: **reviewed** — included in a context-limited batch - `hosts/lena/default.nix`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `justfiles/hosts.just`: **reviewed** — included in a context-limited batch - `lib/auto-update-policy.nix`: **reviewed** — included in a context-limited batch - `modules/common/default-config.nix`: **reviewed** — included in a context-limited batch - `modules/common/nova-remote-builder.nix`: **reviewed** — included in a context-limited batch - `modules/networking/nebula.nix`: **reviewed** — included in a context-limited batch - `potential/chaos/default.nix`: **reviewed** — included in a context-limited batch - `users/nimmo.nix`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 3 - Previous automated review: none found - Findings: 3 </details>
nimmo merged commit c8bebbf2d2 into main 2026-10-08 17:47:02 +01:00
nimmo deleted branch feat/issue-276-consolidate-fleet-boilerplate 2026-10-08 17:47:07 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
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!288
No description provided.