aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/programs/ssh.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/programs/ssh.nix')
-rw-r--r--nixpkgs/nixos/modules/programs/ssh.nix32
1 files changed, 31 insertions, 1 deletions
diff --git a/nixpkgs/nixos/modules/programs/ssh.nix b/nixpkgs/nixos/modules/programs/ssh.nix
index 44e65ee8a9a..40af4d0ff5a 100644
--- a/nixpkgs/nixos/modules/programs/ssh.nix
+++ b/nixpkgs/nixos/modules/programs/ssh.nix
@@ -131,7 +131,7 @@ in
knownHosts = mkOption {
default = {};
- type = types.loaOf (types.submodule ({ name, ... }: {
+ type = types.attrsOf (types.submodule ({ name, ... }: {
options = {
certAuthority = mkOption {
type = types.bool;
@@ -194,6 +194,33 @@ in
'';
};
+ kexAlgorithms = mkOption {
+ type = types.nullOr (types.listOf types.str);
+ default = null;
+ example = [ "curve25519-sha256@libssh.org" "diffie-hellman-group-exchange-sha256" ];
+ description = ''
+ Specifies the available KEX (Key Exchange) algorithms.
+ '';
+ };
+
+ ciphers = mkOption {
+ type = types.nullOr (types.listOf types.str);
+ default = null;
+ example = [ "chacha20-poly1305@openssh.com" "aes256-gcm@openssh.com" ];
+ description = ''
+ Specifies the ciphers allowed and their order of preference.
+ '';
+ };
+
+ macs = mkOption {
+ type = types.nullOr (types.listOf types.str);
+ default = null;
+ example = [ "hmac-sha2-512-etm@openssh.com" "hmac-sha1" ];
+ description = ''
+ Specifies the MAC (message authentication code) algorithms in order of preference. The MAC algorithm is used
+ for data integrity protection.
+ '';
+ };
};
};
@@ -232,6 +259,9 @@ in
${optionalString (cfg.pubkeyAcceptedKeyTypes != []) "PubkeyAcceptedKeyTypes ${concatStringsSep "," cfg.pubkeyAcceptedKeyTypes}"}
${optionalString (cfg.hostKeyAlgorithms != []) "HostKeyAlgorithms ${concatStringsSep "," cfg.hostKeyAlgorithms}"}
+ ${optionalString (cfg.kexAlgorithms != null) "KexAlgorithms ${concatStringsSep "," cfg.kexAlgorithms}"}
+ ${optionalString (cfg.ciphers != null) "Ciphers ${concatStringsSep "," cfg.ciphers}"}
+ ${optionalString (cfg.macs != null) "MACs ${concatStringsSep "," cfg.macs}"}
'';
environment.etc."ssh/ssh_known_hosts".text = knownHostsText;