diff --git a/nixos/modules/security/sudo.nix b/nixos/modules/security/sudo.nix index 4e4f186758e9..ff912dec5073 100644 --- a/nixos/modules/security/sudo.nix +++ b/nixos/modules/security/sudo.nix @@ -41,9 +41,15 @@ in ''; }; - enable = mkEnableOption (mdDoc '' - the {command}`sudo` command, which allows non-root users to execute commands as root. - ''); + enable = mkOption { + type = types.bool; + default = true; + description = + lib.mdDoc '' + Whether to enable the {command}`sudo` command, which + allows non-root users to execute commands as root. + ''; + }; package = mkPackageOption pkgs "sudo" { }; diff --git a/nixos/tests/sudo.nix b/nixos/tests/sudo.nix index 1b177391488d..1fe478f0bff1 100644 --- a/nixos/tests/sudo.nix +++ b/nixos/tests/sudo.nix @@ -21,7 +21,8 @@ in }; security.sudo = { - enable = true; + # Explicitly _not_ defining 'enable = true;' here, to check that sudo is enabled by default + wheelNeedsPassword = false; extraConfig = ''