limit the amount of time ssh-agent keeps a key (default: 1h)
This commit is contained in:
parent
478e4b46d1
commit
d70336f37c
@ -59,6 +59,14 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
agentTimeout = mkOption {
|
||||||
|
type = types.string;
|
||||||
|
default = "1h";
|
||||||
|
description = ''
|
||||||
|
How long to keep the private keys in memory.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
default = pkgs.openssh;
|
default = pkgs.openssh;
|
||||||
description = ''
|
description = ''
|
||||||
@ -99,7 +107,7 @@ in
|
|||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
serviceConfig =
|
serviceConfig =
|
||||||
{ ExecStartPre = "${pkgs.coreutils}/bin/rm -f %t/ssh-agent";
|
{ ExecStartPre = "${pkgs.coreutils}/bin/rm -f %t/ssh-agent";
|
||||||
ExecStart = "${cfg.package}/bin/ssh-agent -a %t/ssh-agent";
|
ExecStart = "${cfg.package}/bin/ssh-agent -t ${cfg.agentTimeout} -a %t/ssh-agent";
|
||||||
StandardOutput = "null";
|
StandardOutput = "null";
|
||||||
Type = "forking";
|
Type = "forking";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
Loading…
Reference in New Issue
Block a user