mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
nixos/sudo: Make the default rules' options configurable
This commit is contained in:
parent
93011e31bd
commit
1852b67bc6
@ -32,6 +32,15 @@ in
|
|||||||
|
|
||||||
options.security.sudo = {
|
options.security.sudo = {
|
||||||
|
|
||||||
|
defaultOptions = mkOption {
|
||||||
|
type = with types; listOf str;
|
||||||
|
default = [ "SETENV" ];
|
||||||
|
description = mdDoc ''
|
||||||
|
Options used for the default rules, granting `root` and the
|
||||||
|
`wheel` group permission to run any command as any user.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
enable = mkEnableOption (mdDoc ''
|
enable = mkEnableOption (mdDoc ''
|
||||||
the {command}`sudo` command, which allows non-root users to execute commands as root.
|
the {command}`sudo` command, which allows non-root users to execute commands as root.
|
||||||
'');
|
'');
|
||||||
@ -188,8 +197,8 @@ in
|
|||||||
inherit users groups;
|
inherit users groups;
|
||||||
commands = [ {
|
commands = [ {
|
||||||
command = "ALL";
|
command = "ALL";
|
||||||
options = opts ++ [ "SETENV" ];
|
options = opts ++ cfg.defaultOptions;
|
||||||
} ];
|
} ];
|
||||||
} ];
|
} ];
|
||||||
in mkMerge [
|
in mkMerge [
|
||||||
# This is ordered before users' `mkBefore` rules,
|
# This is ordered before users' `mkBefore` rules,
|
||||||
|
Loading…
Reference in New Issue
Block a user