mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 19:49:45 +01:00
ssh: add extraConfig option for non-standard options
This commit is contained in:
parent
c9294e30d9
commit
d6ab6ee370
1 changed files with 17 additions and 0 deletions
|
@ -95,6 +95,12 @@ let
|
||||||
default = null;
|
default = null;
|
||||||
description = "The command to use to connect to the server.";
|
description = "The command to use to connect to the server.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraOptions = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
description = "Extra configuration options for the host.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.host = mkDefault name;
|
config.host = mkDefault name;
|
||||||
|
@ -113,6 +119,7 @@ let
|
||||||
" ServerAliveInterval ${toString cf.serverAliveInterval}"
|
" ServerAliveInterval ${toString cf.serverAliveInterval}"
|
||||||
++ 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
|
||||||
);
|
);
|
||||||
|
|
||||||
in
|
in
|
||||||
|
@ -157,6 +164,14 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Extra configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
matchBlocks = mkOption {
|
matchBlocks = mkOption {
|
||||||
type = types.loaOf matchBlockModule;
|
type = types.loaOf matchBlockModule;
|
||||||
default = [];
|
default = [];
|
||||||
|
@ -190,6 +205,8 @@ in
|
||||||
ControlPath ${cfg.controlPath}
|
ControlPath ${cfg.controlPath}
|
||||||
ControlPersist ${cfg.controlPersist}
|
ControlPersist ${cfg.controlPersist}
|
||||||
|
|
||||||
|
${cfg.extraConfig}
|
||||||
|
|
||||||
${concatStringsSep "\n\n" (
|
${concatStringsSep "\n\n" (
|
||||||
map matchBlockStr (
|
map matchBlockStr (
|
||||||
builtins.attrValues cfg.matchBlocks))}
|
builtins.attrValues cfg.matchBlocks))}
|
||||||
|
|
Loading…
Reference in a new issue