ssh: add a few more options
This commit is contained in:
parent
a93445f3fe
commit
b8b595c6b2
|
@ -81,6 +81,12 @@ let
|
||||||
"Set timeout in seconds after which response will be requested.";
|
"Set timeout in seconds after which response will be requested.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
compression = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Specifies whether to use compression.";
|
||||||
|
};
|
||||||
|
|
||||||
checkHostIP = mkOption {
|
checkHostIP = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
@ -117,6 +123,7 @@ let
|
||||||
++ optional (cf.hostname != null) " HostName ${cf.hostname}"
|
++ optional (cf.hostname != null) " HostName ${cf.hostname}"
|
||||||
++ optional (cf.serverAliveInterval != 0)
|
++ optional (cf.serverAliveInterval != 0)
|
||||||
" ServerAliveInterval ${toString cf.serverAliveInterval}"
|
" ServerAliveInterval ${toString cf.serverAliveInterval}"
|
||||||
|
++ optional cf.compression " Compression yes"
|
||||||
++ optional (!cf.checkHostIP) " CheckHostIP no"
|
++ optional (!cf.checkHostIP) " CheckHostIP no"
|
||||||
++ optional (cf.proxyCommand != null) " ProxyCommand ${cf.proxyCommand}"
|
++ optional (cf.proxyCommand != null) " ProxyCommand ${cf.proxyCommand}"
|
||||||
++ mapAttrsToList (n: v: " ${n} ${v}") cf.extraOptions
|
++ mapAttrsToList (n: v: " ${n} ${v}") cf.extraOptions
|
||||||
|
@ -139,6 +146,44 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
compression = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = types.bool;
|
||||||
|
description = "Specifies whether to use compression.";
|
||||||
|
};
|
||||||
|
|
||||||
|
serverAliveInterval = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 0;
|
||||||
|
description = ''
|
||||||
|
Set default timeout in seconds after which response will be requested.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
hashKnownHosts = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Indicates that
|
||||||
|
<citerefentry>
|
||||||
|
<refentrytitle>ssh</refentrytitle>
|
||||||
|
<manvolnum>1</manvolnum>
|
||||||
|
</citerefentry>
|
||||||
|
should hash host names and addresses when they are added to
|
||||||
|
the known hosts file.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
userKnownHostsFile = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "~/.ssh/known_hosts";
|
||||||
|
description = ''
|
||||||
|
Specifies one or more files to use for the user host key
|
||||||
|
database, separated by whitespace. The default is
|
||||||
|
<filename>~/.ssh/known_hosts</filename>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
controlMaster = mkOption {
|
controlMaster = mkOption {
|
||||||
default = "no";
|
default = "no";
|
||||||
type = types.enum ["yes" "no" "ask" "auto" "autoask"];
|
type = types.enum ["yes" "no" "ask" "auto" "autoask"];
|
||||||
|
@ -201,6 +246,10 @@ in
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.file.".ssh/config".text = ''
|
home.file.".ssh/config".text = ''
|
||||||
ForwardAgent ${yn cfg.forwardAgent}
|
ForwardAgent ${yn cfg.forwardAgent}
|
||||||
|
Compression ${yn cfg.compression}
|
||||||
|
ServerAliveInterval ${toString cfg.serverAliveInterval}
|
||||||
|
HashKnownHosts ${yn cfg.hashKnownHosts}
|
||||||
|
UserKnownHostsFile ${cfg.userKnownHostsFile}
|
||||||
ControlMaster ${cfg.controlMaster}
|
ControlMaster ${cfg.controlMaster}
|
||||||
ControlPath ${cfg.controlPath}
|
ControlPath ${cfg.controlPath}
|
||||||
ControlPersist ${cfg.controlPersist}
|
ControlPersist ${cfg.controlPersist}
|
||||||
|
|
Loading…
Reference in a new issue