refactor(fleet): consolidate fleet boilerplate and refine module boundaries (#276) #288
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!288
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/issue-276-consolidate-fleet-boilerplate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Ref #276 (Milestone: Nix Idioms and Architecture Hygiene)
Consolidate DRY violations and non-idiomatic patterns across the fleet:
lena,vega,lyra, andchaoseach declared identicalsops.secrets."nix-remote-builder/<host>-private-key"definitions andsshKeyFilepaths.hostMapinmodules/networking/nebula.nixAND explicitly repeated in host configurations.flake.nixunconditionally includedplasma-managerinhome-manager.sharedModulesfor all hosts, forcing headless servers (Vega, Lyra) to evaluate it and triggering rebuilds inauto-update-policy.nix.extraSpecialArgs:flake.nixpassedprimaryUser,isServer,flakeRepo,userEmail, andhostNameto Home Manager viaextraSpecialArgs, when NixOS-integrated Home Manager modules already receiveosConfig.home/nimmo.nixwas an unused compatibility stub.Changes
modules/common/nova-remote-builder.nix):sops.secrets."nix-remote-builder/${config.networking.hostName}-private-key"whencfg.enableis true.sshKeyFileto the host's secret path and tighten type tolib.types.str.hosts/{lena,lyra,vega}/default.nixandpotential/chaos/default.nix.docs/nova-remote-builder.md.modules/networking/nebula.nix):nixosConfig.nebula.overlayIptohostMap.${hostname}.hosts/{electra,lena,lyra,vega}/default.nixandpotential/chaos/default.nix.inputs.plasma-manager.homeModules.plasma-managerinflake.nixviahome-manager.sharedModules = lib.optional (!config.nixosConfig.host.isServer) ....{ pkgs, ... }:inhome/users/nimmo/plasma.nixsojust plasma-captureremains fully compatible and non-destructive.plasma-managerinlib/auto-update-policy.nixto[ "electra" "lena" ](only desktop laptops).osConfigDirect Access & Host Options:nixosConfig.host.isServerboolean option inmodules/common/default-config.nix.browser.nix,default.nix,desktop.nix,download-organizer.nix,git.nix,shell.nix) now readisServer,primaryUser,userEmail, andflakeRepodirectly fromosConfig.extraSpecialArgsfromflake.nix(now only passes{ inherit inputs; }).justfiles/hosts.just.home/nimmo.nix.users/nimmo.nix.Validation
nix flake checkpassed cleanly (all checks passed! flake check OK, includingformatting,nova-remote-builder-config,service-failure-monitor-coverage,redview-v2-production-config, andauto-update-state-machine).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)vegaandlyraevaluate withoutplasma-manager, whileelectraandlenaevaluate with it.tests/nixos-deploy-regressions.sh,tests/nixos-deploy-wrapper-regressions.sh).tests/backup-restore-regressions.sh).tests/nixos-pin-lifecycle-regressions.sh,tests/nixos-update-remediation-regressions.sh).- 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.Automated code review
Reviewed commit:
beec9237d913482be526d9b7606062bd8d4e60f2Verdict: 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 (insidelib.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'snova-remote-builder-configassertions (flake.nix:222-227) and the files present insecrets/nix-remote-builders/(chaos, electra, lena, lyra, vega); electra keeps its explicit declaration, which flake.nix:235 still requires. The newnebula.overlayIpdefault resolves throughhostMap(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 setsnixosConfig.nebula.enable = trueis inhostMap, so theor (throw ...)guard is not reached. The removedextraSpecialArgskeys (isServer,primaryUser,userEmail,flakeRepo,hostName) are no longer consumed by any file underhome/(all now derive them fromosConfig), the deletedhome/nimmo.nixshim is referenced nowhere,inputsis still passed and is required byhome/users/nimmo/plasma.nix, andnixosConfig.host.role,primaryUser,userEmail,flakeRepoall resolve (hosts setrole; defaults live in modules/common/default-config.nix, imported via modules/common/base.nix:20).plasma.nixis reachable only throughlib.optional (!isServer)(home/users/nimmo/default.nix:20) and only electra/lena setrole = "laptop", so the narrowed plasma-manager host list in lib/auto-update-policy.nix matches the real consumers. Two actionable items remain: the unchangedjust plasma-capturerecipe 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-captureoverwrites the file that now has to supply the plasma-manager import (home/users/nimmo/plasma.nix:11; medium confidence)The diff moves the
inputsfunction parameter andimports = [ inputs.plasma-manager.homeModules.plasma-manager ];(line 11) intohome/users/nimmo/plasma.nix, and removes the correspondinghome-manager.sharedModules = [ inputs.plasma-manager.homeModules.plasma-manager ];from flake.nix.justfiles/hosts.just:302-309is unchanged and definesplasma-captureasTARGET="$REPO_DIR/home/users/nimmo/plasma.nix"followed bynix 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, ... }:, noimportsline and noinputsargument - 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.nixthat no longer defines theprograms.plasmamodule or receivesinputs, so the nextjust plasma-capturefollowed byjust checkwould fail evaluation on electra and lena (the only hosts that importplasma.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-capturewrite to a scratch path and merge, or keep a small stable wrapper module that declares theinputsparameter and theimportsline and imports the generated file into it. Alternatively confirm the upstream generator emits both theinputsparameter and theimportsline, 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-managergroup'shostslist was narrowed from [electra, lena, vega, lyra] to [electra, lena] and its rationale rewritten. This file's own header comment states thehostsfield '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 thehostslists (flake.nix:249 only appendsrootInputsto the policy; no check script consumes it).Impact: The narrowing is consistent with the code (vega and lyra set
role = "server", soplasma.nixis 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
Questions
hosts/electra/default.nixneed to keep declaringsops.secrets."nix-remote-builder/electra-private-key"now that the module provisions that attribute only undercfg.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?justfiles/hosts.just:233-235(which still emitshome-manager.extraSpecialArgs = { inherit inputs; configName = "<host>"; }for new hosts) be aligned with the new minimal{ inherit inputs; }shape, given no module underhome/consumesconfigName?Review limitations
nix flake check,just check, and the regression suites were not run; evaluation success is inferred from reading the sources, not from an evaluation.osConfigis bound in Home Manager module arguments, nor whatnix run github:nix-community/plasma-manageremits; the finding aboutplasma-capturerests on the unchanged recipe and the pre-change file shape shown in the diff.potential/chaos/default.nixis not registered in flake.nix (AGENTS.md:164 statespotential/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.igpu/dgpuspecialisations; I confirmed only that they inheritnixosConfig.host.roleandnetworking.hostNameunchanged, which is the basis for treating the newisServerderivation as tier-neutral.Diff coverage
docs/nova-remote-builder.md: reviewed — included in a context-limited batchflake.nix: reviewed — included in a context-limited batchhome/nimmo.nix: reviewed — included in a context-limited batchhome/users/nimmo/browser.nix: reviewed — included in a context-limited batchhome/users/nimmo/default.nix: reviewed — included in a context-limited batchhome/users/nimmo/desktop.nix: reviewed — included in a context-limited batchhome/users/nimmo/download-organizer.nix: reviewed — included in a context-limited batchhome/users/nimmo/git.nix: reviewed — included in a context-limited batchhome/users/nimmo/plasma.nix: reviewed — included in a context-limited batchhome/users/nimmo/shell.nix: reviewed — included in a context-limited batchhosts/electra/default.nix: reviewed — included in a context-limited batchhosts/lena/default.nix: reviewed — included in a context-limited batchhosts/lyra/default.nix: reviewed — included in a context-limited batchhosts/vega/default.nix: reviewed — included in a context-limited batchlib/auto-update-policy.nix: reviewed — included in a context-limited batchmodules/common/nova-remote-builder.nix: reviewed — included in a context-limited batchmodules/networking/nebula.nix: reviewed — included in a context-limited batchpotential/chaos/default.nix: reviewed — included in a context-limited batchusers/nimmo.nix: reviewed — included in a context-limited batchReview metadata
Automated code review
Reviewed commit:
9938669c71b586aa922634324d9a5018c237e446Verdict: 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
overlayIpdefault in modules/networking/nebula.nix:71-76 resolves throughhostMap(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 everyoverlayIpremoved from the host files, so no registered or potential host changes value. Nova: the module's auto-declaredsops.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 thenova-remote-builder-configcheck's key assertions still hold; electra keeps its own copy at hosts/electra/default.nix:147 and does not enable the builder, so themkIf cfg.enableguard 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 fromosConfig.nixosConfig.*, and modules/common/default-config.nix supplies identical defaults;home/nimmo.nixhas no remaining importer (flake.nix imports ./home/users/), and therole == "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
The change narrows the plasma-manager group's
hostsfrom electra/lena/vega/lyra to electra/lena (lib/auto-update-policy.nix:39-45) and makes flake.nix:146-148 dropinputs.plasma-manager.homeModules.plasma-managerfromhome-manager.sharedModulesforrole == "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 'Usejust testrather than rawnixos-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 teston 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.nixat 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.roleis an enum withdefault = "unspecified"(modules/common/default-config.nix:56-65) and scripts/new-host-template.nix:29 emitsrole = "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.plasmaoptions 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 fromservices.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)
sshKeyFilekeepstype = lib.types.nullOr lib.types.str(line 48) but its default is nowconfig.sops.secrets."nix-remote-builder/${config.networking.hostName}-private-key".path(line 49), which yields a string or fails; the guardassertion = cfg.sshKeyFile != null(line 72) can therefore only fire for an explicitsshKeyFile = nulloverride, not for the default. The secret itself is declared only underlib.mkIf cfg.enable(lines 77-83), so a host that enables the builder withoutsecrets/nix-remote-builders/<host>.jsonfails 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
nullOrtype 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.strand drop the now-unreachable null assertion, or keep a meaningful guard (defaultnull, resolve the sops path inside themkIf cfg.enableblock, retain the assertion). The flake check'sbuilder.sshKey == key.pathassertion (flake.nix:235) remains the deterministic gate either way.Tests and validation
Questions
nixos-auto-updatepackage accept a host being absent from a group'shostslist (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.sops.secrets."nix-remote-builder/electra-private-key"itself (hosts/electra/default.nix:147) while the module now declares the same key name undermkIf cfg.enable. If Electra ever setsnixosConfig.novaRemoteBuilder.enable = true, should that hand-written declaration be removed to avoid a duplicate sops.secrets definition?scripts/new-host-template.nixemit an explicitrole(rather than"unspecified") now that desktop behaviour is gated onrole != "server"in flake.nix and the home modules?Review limitations
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.nixos-auto-updateflake/module/package is an external input; I could not inspect how it consumeslib/auto-update-policy.nixhostsentries orpinnedgroups.osConfigto home modules and submodules is inferred from the checked-out integration (hmFlake.nixosModules.home-managerplushome-manager.users.*at flake.nix:149); the home-manager source was not supplied..sops.yamlrecipient sets, Nebula mesh runtime,/run/secrets/...paths, and actual service activation on vega/lyra remain unverified.flake.lock,.forgejo/workflows/attic-cache.yml, or the upstreamhome-manager/plasma-managersources for option-name compatibility.Diff coverage
docs/nova-remote-builder.md: reviewed — included in a context-limited batchflake.nix: reviewed — included in a context-limited batchhome/nimmo.nix: reviewed — included in a context-limited batchhome/users/nimmo/browser.nix: reviewed — included in a context-limited batchhome/users/nimmo/default.nix: reviewed — included in a context-limited batchhome/users/nimmo/desktop.nix: reviewed — included in a context-limited batchhome/users/nimmo/download-organizer.nix: reviewed — included in a context-limited batchhome/users/nimmo/git.nix: reviewed — included in a context-limited batchhome/users/nimmo/shell.nix: reviewed — included in a context-limited batchhosts/electra/default.nix: reviewed — included in a context-limited batchhosts/lena/default.nix: reviewed — included in a context-limited batchhosts/lyra/default.nix: reviewed — included in a context-limited batchhosts/vega/default.nix: reviewed — included in a context-limited batchjustfiles/hosts.just: reviewed — included in a context-limited batchlib/auto-update-policy.nix: reviewed — included in a context-limited batchmodules/common/nova-remote-builder.nix: reviewed — included in a context-limited batchmodules/networking/nebula.nix: reviewed — included in a context-limited batchpotential/chaos/default.nix: reviewed — included in a context-limited batchusers/nimmo.nix: reviewed — included in a context-limited batchReview metadata
Automated code review
Reviewed commit:
458f10e9a0c1400fdb9a5e1c697781cd497a0bb8Verdict: 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 torole == "server", which reproduces the value flake.nix previously passed asextraSpecialArgs.isServer, so the!isServergates in home/users/nimmo/{default,desktop,browser,download-organizer}.nix keep their prior behaviour;osConfigis supplied by the NixOS-integratedhome-manager.users.<user>path (flake.nix:149), andhome/users/nimmohas no other importer (only flake.nix:149), so deletinghome/nimmo.nixleaves no dangling import and no home module still readsisServer/primaryUser/userEmail/flakeRepo/hostNameas a function argument. The derivednebula.overlayIp(modules/networking/nebula.nix:71-73) resolves throughhostMapto 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-declaredsops.secrets."nix-remote-builder/<host>-private-key"matches theflake.nix:204-235nova-remote-builder-configassertions (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
enablealone, decoupled fromsshKeyFile(modules/common/nova-remote-builder.nix:70; medium confidence)The
lib.mkIf cfg.enableblock (line 69-76) declaressops.secrets."nix-remote-builder/${config.networking.hostName}-private-key"withsopsFile = ../../secrets/nix-remote-builders/${config.networking.hostName}.json, whilesshKeyFile(line 47-55) is a separate option whose default merely points at that attribute. The previousassertionsentry naming the missing credential was removed in the same hunk..sops.yamlgrants path_regex entries only for lyra, electra, vega, chaos and lena (lines 97-136), and those are exactly the files undersecrets/nix-remote-builders/.Impact: Two behaviour changes for any future opt-in: (1) a host setting
enable = truewithout a pre-existingsecrets/nix-remote-builders/<host>.jsonnow fails on an unresolvable Nix path literal instead of the explicit message that was deleted; (2) a host that overridessshKeyFilestill 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.secretsdeclaration on the default actually being used, or restore a diagnostic assertion naming the requiredsecrets/nix-remote-builders/<host>.jsonand its.sops.yamlrecipient 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.yamlrecipient requirement.plasma-manager policy
hostslist is now hand-maintained while the real consumer set became a predicate (lib/auto-update-policy.nix:41; medium confidence)The group's
hostslist 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 addsinputs.plasma-manager.homeModules.plasma-managerunder!config.nixosConfig.host.isServer, and home/users/nimmo/default.nix:20 imports./plasma.nixunder the same predicate, whereisServerisrole == "server"over an enum that also admitsdesktop,workstationandunspecified(modules/common/default-config.nix:52-63). The file's own header states thathostsscopes 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-serverhost, 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
rootInputsfrom 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.isServeris a writable option duplicating therolepredicate still used elsewhere (modules/common/default-config.nix:68; medium confidence)The new option is a writable
lib.types.boolwhose default isconfig.nixosConfig.host.role == "server".modules/server/base.nix:17still 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 documentsnixosConfig.hostas holdingrole,purpose,location,tags, and does not mentionisServer.Impact: Because the option is writable, a host may set
nixosConfig.host.isServerindependently ofrole, so system-side behaviour gated onrole(modules/server/base.nix) and Home Manager / plasma-manager scoping gated onisServercould then disagree. No current host setsisServer, 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 fromrole, and switchmodules/server/base.nix:17to consumeconfig.nixosConfig.host.isServerso only one predicate remains; document the derived field if it stays part ofnixosConfig.host.Tests and validation
Questions
nixosConfig.novaRemoteBuilder.enable = trueandnixosConfig.nebula.enable = true; the module now auto-declaressecrets/nix-remote-builders/chaos.jsonfor it. Is keeping that unregistered draft enabled intentional, or should the draft drop the explicitenablenow that the credential is implied by it?nixosConfig.host.rolewill it carry? Both the plasma-manager scoping (flake.nix:146) andmodules/server/base.nix:17now key off that role, so the choice decides whether it receives desktop Home Manager configuration.modules/server/base.nix:17be migrated to the newisServeroption as part of this refactor, or deliberately left onrole?Review limitations
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.flake.lock,.forgejo/workflows/attic-cache.ymlruntime behaviour, or the pinnednixos-auto-updatepackage implementation, so the meaning ofhostsin 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 retainednix-remote-builder/electra-private-keyblock, and.sops.yamlwere 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.overlayIp,sshKeyFile,novaRemoteBuilder, orplasma.add-hostrecipe in justfiles/hosts.just still prints a registration block that omits the conditionalhome-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 batchflake.nix: reviewed — included in a context-limited batchhome/nimmo.nix: reviewed — included in a context-limited batchhome/users/nimmo/browser.nix: reviewed — included in a context-limited batchhome/users/nimmo/default.nix: reviewed — included in a context-limited batchhome/users/nimmo/desktop.nix: reviewed — included in a context-limited batchhome/users/nimmo/download-organizer.nix: reviewed — included in a context-limited batchhome/users/nimmo/git.nix: reviewed — included in a context-limited batchhome/users/nimmo/shell.nix: reviewed — included in a context-limited batchhosts/electra/default.nix: reviewed — included in a context-limited batchhosts/lena/default.nix: reviewed — included in a context-limited batchhosts/lyra/default.nix: reviewed — included in a context-limited batchhosts/vega/default.nix: reviewed — included in a context-limited batchjustfiles/hosts.just: reviewed — included in a context-limited batchlib/auto-update-policy.nix: reviewed — included in a context-limited batchmodules/common/default-config.nix: reviewed — included in a context-limited batchmodules/common/nova-remote-builder.nix: reviewed — included in a context-limited batchmodules/networking/nebula.nix: reviewed — included in a context-limited batchpotential/chaos/default.nix: reviewed — included in a context-limited batchusers/nimmo.nix: reviewed — included in a context-limited batchReview metadata