nixos/sudo: Make the default rules' options configurable

This commit is contained in:
nicoo 2023-09-07 12:50:48 +00:00
parent b1eab8ca53
commit 717e51a140
2 changed files with 15 additions and 5 deletions

View file

@ -38,6 +38,15 @@ in
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 = mkOption {
type = types.bool;
default = true;
@ -206,8 +215,8 @@ in
inherit users groups;
commands = [ {
command = "ALL";
options = opts ++ [ "SETENV" ];
} ];
options = opts ++ cfg.defaultOptions;
} ];
} ];
in mkMerge [
# This is ordered before users' `mkBefore` rules,