summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/programs/ssh.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix
index 005c77d255cb..fdb9dfd4b8c2 100644
--- a/nixos/modules/programs/ssh.nix
+++ b/nixos/modules/programs/ssh.nix
@@ -91,9 +91,12 @@ in
         description = "SSH Agent";
         wantedBy = [ "default.target" ];
         serviceConfig =
-          { ExecStart = "${pkgs.openssh}/bin/ssh-agent -a %t/ssh-agent";
+          { ExecStartPre = "${pkgs.coreutils}/bin/rm -f %t/ssh-agent";
+            ExecStart = "${pkgs.openssh}/bin/ssh-agent -a %t/ssh-agent";
+            StandardOutput = "null";
             Type = "forking";
             Restart = "on-failure";
+            SuccessExitStatus = "0 2";
           };
       };