Skip to content

Commit

Permalink
ssh : fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pasqui23 committed Dec 15, 2024
1 parent 85e8db6 commit b3184e1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions modules/programs/ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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))}
Expand Down

0 comments on commit b3184e1

Please sign in to comment.