Commit 92c59455168d
Changed files (1)
home
common
shell
home/common/shell/openssh.nix
@@ -84,9 +84,16 @@ in
# Override the sshAuthSock module's shell initialization so all shells
# (bash, zsh, fish) point at the TPM agent socket, not the plain ssh-agent.
- sshAuthSock.initialization.bash = lib.mkIf isAomi (
- lib.mkForce ''export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-tpm-agent.sock"''
- );
+ #
+ # The guard must sit at the `initialization` level, not the `.bash` leaf:
+ # assigning `sshAuthSock.initialization.bash = lib.mkIf isAomi ...` still
+ # defines the parent `initialization` as a non-null attrset on every host,
+ # which activates the upstream module's config block and forces a read of
+ # `.bash`/`.fish`/`.nushell` (no defaults) -> eval failure on non-aomi hosts.
+ # On aomi, services.ssh-agent supplies fish/nushell; we only override bash.
+ sshAuthSock.initialization = lib.mkIf isAomi {
+ bash = lib.mkForce ''export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-tpm-agent.sock"'';
+ };
# GUI terminals spawned under niri inherit the systemd user manager
# environment, so set SSH_AUTH_SOCK there too via environment.d.