diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix index 005c77d255c..fdb9dfd4b8c 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"; }; };