Repository navigation
fix(clan): migrate clan machine path off removed clanModules (#159) - #3684
Conversation
clan-core at the locked rev (8b9fd720) exports no clanModules output, so evaluating nixosConfigurations.user failed with "attribute clanModules missing" at modules/disko.nix:12. - modules/disko.nix: standalone static disko config per the upstream disk-id migration guide; disk name keeps the machine generated diskId (cross-checked against vars/per-machine/user/disk-id/diskId/value). Device stays in machines/user/configuration.nix. - modules/shared.nix: drop the dead sshd/root-password/user-password/state-version imports and the clan.user-password option. sshd and password generation are now clanServices inventory instances; state-version is enabled by clanCore defaults. Also move programs.gvfs -> services.gvfs (option renamed upstream; it blocked evaluation of the same file). - lib/default.nix (make-clan): inventory.instances for sshd (CA certificates disabled - the old module only generated host keys and this repo has no shared openssh-ca vars), users instances for root and user passwords, and the zerotier network. - machines/user/configuration.nix: remove clan.core.networking.zerotier.controller.enable (direct option removed upstream); the machine is controller+peer of the zerotier inventory instance instead. - vars/shared/zerotier-network-zerotier/network-id/value: seed the public network-id var with the machines existing network id from machines/user/facts/zerotier-network-id (value-preserving; the zerotier identity var is generated at deploy time by clan vars generate).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6306477842
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1 @@ | |||
| c5e451b2d6c22070 No newline at end of file | |||
There was a problem hiding this comment.
Migrate the controller identity together with its network ID
On deployment, this preserves the old network ID without migrating the controller identity from sops/secrets/user-zerotier-identity-secret/secret into the new vars store. A newly generated identity cannot control this network: ZeroTier's protocol documentation specifies that the first 10 hex digits of a network ID identify its controller, so this network requires the identity c5e451b2d6. Being both controller and peer does not allow a different identity to authorize itself on that network. Import the existing controller identity before generating/deploying the new service; preserving identities alongside network IDs is also required by the Clan migration guide.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Accepted — verified, not merging past this.
Verified on the PR head (6306477): vars/per-machine/user/ contains only disk-id, openssh, and state-version — there is no zerotier identity in the vars store, while the controller identity exists only at sops/secrets/user-zerotier-identity-secret. The PR preserves the network ID (vars/shared/zerotier-network-zerotier/network-id/value) without importing that identity, so a deploy-time vars generation would mint a new controller identity that cannot authorize peers on this network (network-ID prefix = controller identity, per the linked ZeroTier doc and the Clan zerotier migration guide).
Disposition: merge of PR #3684 is blocked on this finding. Fix path (queue task 2943, parked with this as the resume condition): import the existing controller identity from the sops secret into the zerotier service's vars before any deploy, per the Clan migration guide — a deliberate secrets-handling step, not done in a shift tail. Alternative if the import proves impractical: split the zerotier instance out of this PR and re-verify eval. The rest of the PR is verified: nix eval .#nixosConfigurations.user.config.system.build.toplevel.drvPath passes at head and no clanModules refs remain in modules/*.nix.
Fixes #159.
nixosConfigurations.userfailed to evaluate at main:attribute 'clanModules' missingatmodules/disko.nix:12. The locked clan-core rev (8b9fd720) exports noclanModulesoutput at all — the old modules were replaced by clanServices. Reproduced on laptop at main9df0b20c3before this change.What changed
modules/disko.nix— standalone static disko configuration per the upstream disk-id migration guide. The dynamicclan.core.vars.generators.disk-idsuffix is replaced with the machine's generated diskId, cross-checked againstvars/per-machine/user/disk-id/diskId/value(822c2b3a…59a, matches the 2026-10-12 audit on Root flake check fails on nixosConfigurations due to missing clan-core.clanModules #159 — not invented). The device stays inmachines/user/configuration.nix(module merge, unchanged semantics).modules/shared.nix— the four dead imports and the removedclan.user-passwordoption are gone. Alsoprograms.gvfs→services.gvfs: that option was renamed upstream and blocked evaluation of this same file once the import error was fixed.lib/default.nix(make-clan) — the services now live where clan-core at this rev requires them:inventory.instances. At the locked rev, sshd/users are_class = "clan.service"modules — they cannot be imported into a NixOS configuration, so the packet's shared.nix mechanism is implemented via inventory instead:sshd(server role, all machines). CA-signed host certificates disabled: the old sshd module only generated host keys, and this repo has no sharedopenssh-cavars — enabling certs made eval throw for the missing var.user-root/user-user(usersservice) — generate the root anduserpasswords (wereroot-password/user-password). Their vars don't exist in the store yet; they are created byclan vars generate userat deploy time (same status as before: the old generators also had no vars in the repo).state-versionneeds no instance: clanCore enablesclan.core.settings.state-versionby default, and the existing var yields25.05.zerotier— see below.machines/user/configuration.nix— removedclan.core.networking.zerotier.controller.enable(the direct option was removed upstream and threw on evaluation). The machine is nowcontroller+peerof the zerotier inventory instance. This file's scope in the packet was "import adjustments only", but the removed option made the whole machine path unevaluable; the inventory instance is the upstream-prescribed replacement (zerotier migration guide).vars/shared/zerotier-network-zerotier/network-id/value— new public var seeded with the machine's existing network ID frommachines/user/facts/zerotier-network-id(c5e451b2d6c22070), value-preserving as the migration guide prescribes. The zerotier identity var does not exist in the repo (only legacy facts) and is generated byclan vars generateat deploy time; the machine is its own controller, so it can accept itself after regeneration.Verification (laptop, this branch)
nix eval .#nixosConfigurations.user.config.system.build.toplevel.drvPath— evaluates cleanly (failed atmodules/disko.nix:12on main).services.openssh.enable = true,system.stateVersion = "25.05",disko.devices.disk.main.name = "main-822c2b3a90814675aa45e433aa1fe59a", device unchanged, root anduserhashedPasswordFileset by the users service,services.zerotierone.enable = true.grep clanModules modules/*.nix— clean.nixfmt --checkon all touched files — clean.Queue task 2943 (repo-health-code-pilot), Lane D.
Need help on this PR? Tag
@codesmith-botwith what you need.