diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 6cc86b4e4b5a..14d516ddbb66 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -268,6 +268,16 @@ in }; }; + moduliFile = mkOption { + example = "services.openssh.moduliFile = /etc/my-local-ssh-moduli;"; + type = 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.extraUsers = mkOption { @@ -286,8 +296,10 @@ in description = "SSH privilege separation user"; }; + services.openssh.moduliFile = mkDefault "${cfgc.package}/etc/ssh/moduli"; + environment.etc = authKeysFiles ++ [ - { source = "${cfgc.package}/etc/ssh/moduli"; + { source = cfg.moduliFile; target = "ssh/moduli"; } { text = knownHostsText;