Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions modules/programs/ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,18 @@ let
example = "10m";
description = "Whether control socket should remain open in the background.";
};

kexAlgorithms = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
example = [
"[email protected]"
"diffie-hellman-group-exchange-sha256"
];
description = ''
Specifies the available KEX (Key Exchange) algorithms.
'';
};
};

# config.host = mkDefault dagName;
Expand Down Expand Up @@ -451,6 +463,9 @@ let
++ map (f: " LocalForward" + addressPort f.bind + addressPort f.host) cf.localForwards
++ map (f: " RemoteForward" + addressPort f.bind + addressPort f.host) cf.remoteForwards
++ map (f: " DynamicForward" + addressPort f) cf.dynamicForwards
++ optional (
cf.kexAlgorithms != null
) " KexAlgorithms ${builtins.concatStringsSep "," cf.kexAlgorithms}"
++ mapAttrsToList (n: v: " ${n} ${v}") cf.extraOptions
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Host xyz
RemoteForward [localhost]:8081 [10.0.0.2]:80
RemoteForward /run/user/1000/gnupg/S.gpg-agent.extra /run/user/1000/gnupg/S.gpg-agent
DynamicForward [localhost]:2839
KexAlgorithms sntrup761x25519-sha512,[email protected],mlkem768x25519-sha256
Host ordered
Port 1

Expand Down
5 changes: 5 additions & 0 deletions tests/modules/programs/ssh/match-blocks-attrs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
host.address = "/run/user/1000/gnupg/S.gpg-agent";
}
];
kexAlgorithms = [
"sntrup761x25519-sha512"
"[email protected]"
"mlkem768x25519-sha256"
];
dynamicForwards = [ { port = 2839; } ];
setEnv = {
FOO = "foo12";
Expand Down