ssh/1password/ssh-agent-switcher: move off home-manager to the system layer (#46)#76
Merged
Merged
Conversation
… layer (#46) The shared HM ssh, _1password, and ssh-agent-switcher modules are deleted and re-expressed per platform, following the my.* rule that only package-bakeable pieces become wrappers — these are system state, so they land on upstream NixOS/nix-darwin options instead: - modules/ssh/client-config.nix is the single source of truth for the client Host blocks (brutus/litus multiplexing + zmx attach, pibitcoin, 1Password IdentityAgent), rendered into NixOS programs.ssh.extraConfig (thebeast), nix-darwin programs.ssh.extraConfig -> /etc/ssh/ssh_config.d (macbooks; work-macbook keeps its github-only Match), and a seeded real ~/.ssh/config on the standalone-HM fedora box. - services.ssh-agent-switcher becomes a NixOS module (systemd user service + sessionVariables SSH_AUTH_SOCK, both of which reach my.fish login shells via setEnvironment), replacing upstream's loginShellInit-based module via disabledModules; enabled on litus + brutus, with an e2e VM test (forwarded agent -> switcher socket across reconnects). - 1Password: thebeast keeps the system programs._1password{,-gui} it already had and exports SSH_AUTH_SOCK at the PAM level; the macbooks use nix-darwin's programs._1password (op CLI; the GUI stays the external /Applications app); fedora installs the nixGL-wrapped GUI + CLI from home.packages. git/jj ssh-signing wiring the HM module injected is now explicit per host. Per-host SSH_AUTH_SOCK winner: 1Password agent on thebeast, home-macbook, and fedora; ssh-agent-switcher on litus and brutus; Chef-managed corp setup on work-macbook (1Password only signs/serves github.com). Closes #46 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f1ff594 to
4cd4969
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46 (the last per-host rollout rows of the hm-removal matrix for this module).
What moved where
Per the issue's target,
my.*only wraps packages — everything here is system state, so it lands on upstream NixOS/nix-darwin options instead of new wrappers:modules/ssh/client-config.nix— single source of truth for the shared clientHostblocks (brutus/litus multiplexing + zmxRemoteCommandattach, pibitcoin agent forwarding, 1PasswordIdentityAgent). Consumed by:programs.ssh.extraConfig(rendered first in/etc/ssh/ssh_config, so host blocks win);programs.ssh.extraConfig→/etc/ssh/ssh_config.d/100-nix-darwin.conf(work-macbook keeps its github-onlyMatch host "github.com" user gitagent scope);~/.ssh/configviahome.file+ the existing 0600 materialize hook (full managed-files story stays Foundation: standalone activation story (work-devserver, fedora) #39).services.ssh-agent-switcherbecomes a NixOS module (modules/nixos/services/ssh-agent-switcher.nix): supervised systemd user service +environment.sessionVariables.SSH_AUTH_SOCK = /tmp/ssh-agent.$USER(PAM maps$USER→@{PAM_USER}; shells re-export viasetEnvironment, which the my.fish preinit sources). Upstream 26.05 ships a module under the same name, but it daemonizes fromenvironment.loginShellInit, which my.fish login shells never source — so it's swapped out viadisabledModules(comment in the module explains). Enabled on litus + brutus.programs._1password{,-gui}and now exportsSSH_AUTH_SOCKat the PAM level; macbooks use nix-darwin'sprograms._1password(op CLI — the GUI stays the external/Applicationsapp); fedora installs the nixGL-wrapped GUI + CLI fromhome.packageswith the autostart entry inlined. The git/jj ssh-signing wiring the deleted HM_1passwordmodule injected is now explicit per host (home-macbook + fedora HM settings; thebeast/work-macbook already had it flattened inmy.nix).Per-host
SSH_AUTH_SOCKwinner: 1Password agent on thebeast, home-macbook, fedora; ssh-agent-switcher on litus + brutus; Chef-managed corp setup on work-macbook.Deleted:
sharedModules/programs/{ssh,_1password}.nix,sharedModules/services/ssh-agent-switcher.nix, and all per-host HM enables. work-macbook'sprograms/home-manager.nixis gone entirely — after #75 moved ghostty tomy.*and this PR moved ssh/1Password, nothing remained. work-devserver keeps its HM ssh (out of scope, #39) with an explicitenableDefaultConfig = falseto preserve its rendered config.Testing
checks.x86_64-linux.ssh-agent-switcher: forwarded agent → login shell sees the stable/tmp/ssh-agent.testersocket (not sshd's per-connection one) →ssh-add -llists the key through the switcher → survives reconnects.nixosConfigurations×3,darwinConfigurations×2,homeConfigurations×2) evaluate; thebeast's renderedextraConfigdiffs clean against the old HM output.nix flake checkis green, rebased on top of my.ghostty: finish the wrapper + darwin Dock-launch story (#44) #75 (whose hardenedomarchy/gtk.nixcursor guard also fixed themy-hyprland-configeval failure this branch had initially patched on the test side — that commit was dropped in the rebase). Theomarchy-session-unitsuwsm-stop race flaked once and passed on re-run (identical drv to main).🤖 Generated with Claude Code