From d57110fabc92116e8a47fc708580fe1a1d10d98e Mon Sep 17 00:00:00 2001 From: Aristid Breitkreuz Date: Sat, 15 Nov 2014 12:13:19 +0100 Subject: ssh-agent: make key timeout optional --- nixos/modules/programs/ssh.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nixos/modules/programs/ssh.nix') diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix index c1c1582ed787..6b7295722485 100644 --- a/nixos/modules/programs/ssh.nix +++ b/nixos/modules/programs/ssh.nix @@ -63,7 +63,7 @@ in type = types.string; default = "1h"; description = '' - How long to keep the private keys in memory. + How long to keep the private keys in memory. Use null to keep them forever. ''; }; @@ -107,7 +107,10 @@ in wantedBy = [ "default.target" ]; serviceConfig = { ExecStartPre = "${pkgs.coreutils}/bin/rm -f %t/ssh-agent"; - ExecStart = "${cfg.package}/bin/ssh-agent -t ${cfg.agentTimeout} -a %t/ssh-agent"; + ExecStart = + "${cfg.package}/bin/ssh-agent " + + optionalString (cfg.agentTimeout != null) ("-t ${cfg.agentTimeout} ") + + "-a %t/ssh-agent"; StandardOutput = "null"; Type = "forking"; Restart = "on-failure"; -- cgit 1.4.1