ssh : fix formatting

This commit is contained in:
paki23 2024-04-08 15:06:32 +02:00
parent 9bbbe634d2
commit 78c2aa82eb
No known key found for this signature in database
GPG Key ID: 13160FFB4CEB03F2
1 changed files with 8 additions and 9 deletions

View File

@ -537,15 +537,14 @@ in {
home.file.".ssh/config".source = mkIf cfg.internallyManaged cfg.configPath;
programs.ssh.configPath =
let
sortedMatchBlocks = hm.dag.topoSort cfg.matchBlocks;
sortedMatchBlocksStr = builtins.toJSON sortedMatchBlocks;
matchBlocks =
sortedMatchBlocks.result or abort "Dependency cycle in SSH match blocks: ${sortedMatchBlocksStr}";
in pkgs.writeText "ssh_config" ''
${concatStringsSep "\n" (
(mapAttrsToList (n: v: "${n} ${v}") cfg.extraOptionOverrides)
programs.ssh.configPath = let
sortedMatchBlocks = hm.dag.topoSort cfg.matchBlocks;
sortedMatchBlocksStr = builtins.toJSON sortedMatchBlocks;
matchBlocks = sortedMatchBlocks.result or abort
"Dependency cycle in SSH match blocks: ${sortedMatchBlocksStr}";
in pkgs.writeText "ssh_config" ''
${concatStringsSep "\n"
((mapAttrsToList (n: v: "${n} ${v}") cfg.extraOptionOverrides)
++ (optional (cfg.includes != [ ]) ''
Include ${concatStringsSep " " cfg.includes}
'') ++ (map (block: matchBlockStr block.name block.data) matchBlocks))}