diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index b11f996c63cf..b2740bd33b7f 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -9,12 +9,6 @@ let nssModulesPath = config.system.nssModules.path; - permitRootLoginCheck = v: - v == "yes" || - v == "without-password" || - v == "forced-commands-only" || - v == "no"; - knownHosts = map (h: getAttr h cfg.knownHosts) (attrNames cfg.knownHosts); knownHostsText = flip (concatMapStringsSep "\n") knownHosts @@ -116,12 +110,9 @@ in permitRootLogin = mkOption { default = "without-password"; - type = types.addCheck types.str permitRootLoginCheck; + type = types.enum ["yes" "without-password" "forced-commands-only" "no"]; description = '' - Whether the root user can login using ssh. Valid values are - yes, without-password, - forced-commands-only or - no. + Whether the root user can login using ssh. ''; };