home-shared: migrate programs.ssh.matchBlocks to programs.ssh.settings #79
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#79
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
modules/home-shared.nixdefines the operator's SSH hosts throughprograms.ssh.matchBlocks, which Home Manager 26.05 deprecates in favour ofprograms.ssh.settings. Every VM build and the hypervisor's user profile now print one warning for the option and one more for each host inidentity.sshHoststhat carriesextraOptions. The rendered~/.ssh/configis unchanged today, but the alias is slated for removal, and the warning wall hides real evaluation output such as therebuild-nexuspreview.Migrate the module to
programs.ssh.settings.identity.sshHostskeeps its current shape, since it is data in the deployment's private secrets fork: the module translates the keys it uses (hostname,user,port,identityFile,identitiesOnly) to the upstream directive names (HostName,User,Port,IdentityFile,IdentitiesOnly) and mergesextraOptionsinto the block directly, since its keys are already upstream directive names. A key the translation does not know fails evaluation naming the host and the key rather than being dropped. The forge host'sIdentityFilestayslib.mkDefaultso a profile's own definition still wins.Merge order with the matching profiles change (allod/profiles, migrating
hosts/dev/allod-dev/home.nix) must not matter: Home Manager converts any remainingmatchBlocksdefinition intosettings, and two definitions of the same host block merge attribute by attribute, so a migrated framework beside an unmigrated profile, or the reverse, renders the same config. The check below pins that.Validation
A check that builds a fixture home configuration through the real
home-shared.nixwith a fixture identity whosesshHostsinclude a plain host, a host withportandidentitiesOnly, and a host withextraOptions, plus one legacyprograms.ssh.matchBlocksdefinition of the forge host from a second module standing in for an unmigrated profile. It runsssh -G <host> -F <generated config>for each host and asserts the resolvedhostname,user,port,identityfileand the extra directive, and asserts that the profile's identity file wins for the forge host. Evaluation of the fixture emits noprograms.ssh.matchBlockswarning from this module.Scope
In:
modules/home-shared.nix, the check, its registration inflake.nix. Out:identity.sshHosts's shape in the secrets template, the profiles-sidematchBlocks(allod/profiles issue), the neovim default warnings (same issue).Correction to the issue text. The claim that merge order with the profiles change does not matter is wrong, measured while implementing: with this module still on
programs.ssh.matchBlocksand a profile already onprograms.ssh.settings, Home Manager's legacy conversion evaluates the module's block first, loses thelib.mkDefaultonidentityFile, and re-definessettings.<forge host>.IdentityFileat normal priority as a list. The profile's string then conflicts by type (or by value if written as a list), and the machine fails to evaluate. The reverse order, this module migrated with the profile still legacy, is the one that works, because the priority filter drops the module's default before types are compared; that is the order the new check pins.So the sequencing is: this change lands first, and the deploy lock takes it at or before the profiles change in allod/profiles#8. The PR bodies on both sides state the order.
Direction change. The migration now lands as part of allod/archetypes#54, which moves the forge entry into the dev VM builder and sends
identity.sshHoststo the hypervisor only, so the two-author seam that made merge order matter here no longer exists. The translation and thessh -Gcheck from allod/archetypes#80 are harvested into that change. Tracking is allod/strategy#56; the allod/archetypes#54 pull request closes this issue as well.closed in favor of allod/strategy#56