diff --git a/modules/services/ssh-agent.nix b/modules/services/ssh-agent.nix index 35714e2b9..8bb68a40a 100644 --- a/modules/services/ssh-agent.nix +++ b/modules/services/ssh-agent.nix @@ -84,13 +84,11 @@ in ''; in { - bash.initExtra = lib.mkIf cfg.enableBashIntegration bashIntegration; - - zsh.initContent = lib.mkIf cfg.enableZshIntegration bashIntegration; - - fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration fishIntegration; - - nushell.extraConfig = lib.mkIf cfg.enableNushellIntegration nushellIntegration; + # $SSH_AUTH_SOCK has to be set early since other tools rely on it + bash.profileExtra = lib.mkIf cfg.enableBashIntegration (lib.mkOrder 900 bashIntegration); + fish.shellInit = lib.mkIf cfg.enableFishIntegration (lib.mkOrder 900 fishIntegration); + nushell.extraConfig = lib.mkIf cfg.enableNushellIntegration (lib.mkOrder 900 nushellIntegration); + zsh.envExtra = lib.mkIf cfg.enableZshIntegration (lib.mkOrder 900 bashIntegration); }; } diff --git a/tests/modules/services/ssh-agent/darwin/bash-integration.nix b/tests/modules/services/ssh-agent/darwin/bash-integration.nix index b4fb91096..2341462ac 100644 --- a/tests/modules/services/ssh-agent/darwin/bash-integration.nix +++ b/tests/modules/services/ssh-agent/darwin/bash-integration.nix @@ -8,7 +8,7 @@ nmt.script = '' assertFileContains \ - home-files/.bashrc \ + home-files/.profile \ 'export SSH_AUTH_SOCK=$(@getconf-system_cmds@/bin/getconf DARWIN_USER_TEMP_DIR)/ssh-agent' ''; }