diff options
author | Aristid Breitkreuz <aristidb@gmail.com> | 2014-11-15 12:13:19 +0100 |
---|---|---|
committer | Aristid Breitkreuz <aristidb@gmail.com> | 2014-11-15 12:13:25 +0100 |
commit | d57110fabc92116e8a47fc708580fe1a1d10d98e (patch) | |
tree | 10e911336637c9d1c796e8e98e1f5bbe603c482d /nixos/modules/programs/ssh.nix | |
parent | d70336f37c3cc6f19d85a5fb4852de25c2ee82b9 (diff) | |
download | nixlib-d57110fabc92116e8a47fc708580fe1a1d10d98e.tar nixlib-d57110fabc92116e8a47fc708580fe1a1d10d98e.tar.gz nixlib-d57110fabc92116e8a47fc708580fe1a1d10d98e.tar.bz2 nixlib-d57110fabc92116e8a47fc708580fe1a1d10d98e.tar.lz nixlib-d57110fabc92116e8a47fc708580fe1a1d10d98e.tar.xz nixlib-d57110fabc92116e8a47fc708580fe1a1d10d98e.tar.zst nixlib-d57110fabc92116e8a47fc708580fe1a1d10d98e.zip |
ssh-agent: make key timeout optional
Diffstat (limited to 'nixos/modules/programs/ssh.nix')
-rw-r--r-- | nixos/modules/programs/ssh.nix | 7 |
1 files changed, 5 insertions, 2 deletions
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"; |