home-shared: migrate programs.ssh.matchBlocks to programs.ssh.settings #80
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes!80
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/ssh-settings"
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?
Every VM user profile and the hypervisor's user profile stop printing the
programs.ssh.matchBlocksdeprecation warnings:modules/home-shared.nixnow defines the operator's SSH hosts throughprograms.ssh.settings, the option Home Manager 26.05 replaced the alias with. The rendered~/.ssh/configis unchanged, and the built VM system is byte-identical: evaluating the deploy template'sallod-devwith this change gives the same derivation path as without it.identity.sshHostskeeps its shape, so the private secrets fork needs no edit. A new flake check builds the module against a fixture identity and resolves every host with a realssh -G. If it is wrong, revert this PR; nothing else depends on it yet.Merge order with allod/profiles#9 (issue allod/profiles#8). That profile defines the same forge-host block. This PR must land, and the deploy lock must take it, at or before the profiles change: with this module still on
matchBlocksand the profile already onsettings, Home Manager's legacy conversion drops this module'smkDefaultand retypes the identity file, andallod-devfails to evaluate with a conflicting-type error. Measured, not assumed. The reverse order is safe and is what the new check pins.What changes
modules/home-shared.nix: a small translation turns eachidentity.sshHostsentry (hostname,user,port,identityFile,identitiesOnly) into the upstream directive names (HostName,User,Port,IdentityFile,IdentitiesOnly) and mergesextraOptionsinto the block, since its keys already are directive names andsettings.*.extraOptionsis rejected by Home Manager. Any other key fails evaluation naming the host and the key rather than being dropped. The forge host'sIdentityFilestays underlib.mkDefaultso a profile's own definition wins.checks/ssh-settings.nix, registered asssh-settings: two fixture home configurations through the real module, one with a second module defining the forge host through legacymatchBlocks(an unmigrated profile), one without.ssh -G -F <generated config> <host>resolves a plain host, a host withextraOptions, and the forge host, and the check asserts hostname, user, port, identity file,IdentitiesOnlyand the extra directive, that the legacy profile's identity file wins when present, that the module's default wins when it is absent, and that the module defines nomatchBlocks.Risk
R3: a shared interface consumed by every VM and by the host user profile. The worst credible failure after validation is a deployment's
sshHostsentry carrying a key the translation does not know, which is a loud evaluation error at the next lock bump, not a silent config change. The authoritative data is untouched. Rollback is a revert.Validation
Run by the integrator at
549eca4:nix build .#checks.x86_64-linux.ssh-settings --rebuildexits 0.nix flake check --no-buildreports all checks passed.--override-input archetypes <this worktree>:allod-devevaluates to the same toplevel derivation as master (is37d2i7…), and the onlymatchBlockswarning left nameshosts/dev/allod-dev/home.nixin profiles. With--override-input profilesset to the allod/profiles#8 branch as well: no warnings, and the rendered~/.ssh/configis byte-identical to the current one.Cold cross-family review:
gpt-5.6-solviacodex exec, reasoning efforthigh, read the diff at52e9e08(a Claude-family worker authored it). Three findings. One marked blocker, that the check does not pin the profile-first order: that order fails in Home Manager itself and cannot be made to pass by this module, so it is the merge-order constraint above rather than a code change; the issue text that claimed order would not matter is corrected in a comment on allod/archetypes#79. Two should-fix, both real and fixed in549eca4: anextraOptionskey colliding with a translated directive silently replaced the typed value, now an evaluation error with a sabotage fixture in the check; and the identity-file assertions were substring matches, now exact full-line equality over the wholessh -Gresult. The integrator also fixed athrowwhose message was truncated by operator precedence. No second reading follows the fix round; the fixes are settled by the rebuilt check and the deploy measurements above.Closes allod/archetypes#79
549eca4696toc71704d834Hold, do not merge. Measured against a deployment whose
sshHostsentries carrylocalForwards, this branch atc71704dfails to evaluate every machine that consumes that identity:The body's claim that a deployment's secrets fork needs no edit does not hold; the validation covered the public template, whose entries have no forwarding fields. The failure is loud, so nothing wrong would deploy, but the translation must know every field the address book can carry, and the template should carry them so the check sees them. Separately, the body cites validation and a fix round at
549eca4, which is not an ancestor of the branch tip.The direction has also changed: allod/archetypes#54 now removes the two-author seam instead of porting the
mkDefaultto the new option, which is what forced the landing order this PR documents. The translation function and thessh -Gcheck here are good and are harvested into that change; this PR closes when it lands. Tracking is allod/strategy#56.closed in favor of allod/strategy#56
Pull request closed