nixos/sshd: remove 'moduliFile' option, in favour of settings.ModuliFile (#510900)

This commit is contained in:
tomf
2026-07-17 10:51:39 +00:00
committed by GitHub
+12 -12
View File
@@ -232,6 +232,10 @@ in
"openssh"
"banner"
] "Use services.openssh.settings.Banner instead.")
(lib.mkRenamedOptionModule
[ "services" "openssh" "moduliFile" ]
[ "services" "openssh" "settings" "ModuliFile" ]
)
];
###### interface
@@ -729,6 +733,14 @@ in
'';
example = "/etc/ssh/banner";
};
ModuliFile = lib.mkOption {
type = lib.types.path;
default = "${config.services.openssh.package}/etc/ssh/moduli";
defaultText = lib.literalExpression ''"''${config.services.openssh.package}/etc/ssh/moduli"'';
description = ''
Specifies the {manpage}`moduli(5)` file to use for Diffie-Hellman key exchange.
'';
};
};
}
);
@@ -740,16 +752,6 @@ in
description = "Verbatim contents of {file}`sshd_config`.";
};
moduliFile = lib.mkOption {
example = "/etc/my-local-ssh-moduli;";
type = lib.types.path;
description = ''
Path to `moduli` file to install in
`/etc/ssh/moduli`. If this option is unset, then
the `moduli` file shipped with OpenSSH will be used.
'';
};
};
users.users = lib.mkOption {
@@ -770,14 +772,12 @@ in
};
users.groups.sshd = { };
services.openssh.moduliFile = lib.mkDefault "${cfg.package}/etc/ssh/moduli";
services.openssh.sftpServerExecutable = lib.mkDefault "${cfg.package}/libexec/sftp-server";
environment.etc =
authKeysFiles
// authPrincipalsFiles
// {
"ssh/moduli".source = cfg.moduliFile;
"ssh/sshd_config".source = sshconf;
};