ssh : fix formatting
This commit is contained in:
parent
9bbbe634d2
commit
3558f96edd
|
@ -537,15 +537,14 @@ in {
|
||||||
|
|
||||||
home.file.".ssh/config".source = mkIf cfg.internallyManaged cfg.configPath;
|
home.file.".ssh/config".source = mkIf cfg.internallyManaged cfg.configPath;
|
||||||
|
|
||||||
programs.ssh.configPath =
|
programs.ssh.configPath = let
|
||||||
let
|
|
||||||
sortedMatchBlocks = hm.dag.topoSort cfg.matchBlocks;
|
sortedMatchBlocks = hm.dag.topoSort cfg.matchBlocks;
|
||||||
sortedMatchBlocksStr = builtins.toJSON sortedMatchBlocks;
|
sortedMatchBlocksStr = builtins.toJSON sortedMatchBlocks;
|
||||||
matchBlocks =
|
matchBlocks = sortedMatchBlocks.result or (abort
|
||||||
sortedMatchBlocks.result or abort "Dependency cycle in SSH match blocks: ${sortedMatchBlocksStr}";
|
"Dependency cycle in SSH match blocks: ${sortedMatchBlocksStr}");
|
||||||
in pkgs.writeText "ssh_config" ''
|
in pkgs.writeText "ssh_config" ''
|
||||||
${concatStringsSep "\n" (
|
${concatStringsSep "\n"
|
||||||
(mapAttrsToList (n: v: "${n} ${v}") cfg.extraOptionOverrides)
|
((mapAttrsToList (n: v: "${n} ${v}") cfg.extraOptionOverrides)
|
||||||
++ (optional (cfg.includes != [ ]) ''
|
++ (optional (cfg.includes != [ ]) ''
|
||||||
Include ${concatStringsSep " " cfg.includes}
|
Include ${concatStringsSep " " cfg.includes}
|
||||||
'') ++ (map (block: matchBlockStr block.name block.data) matchBlocks))}
|
'') ++ (map (block: matchBlockStr block.name block.data) matchBlocks))}
|
||||||
|
|
Loading…
Reference in a new issue