@@ -46,6 +46,14 @@ in
4646 <filename>sudoers</filename> file.
4747 '';
4848 };
49+
50+ security.sudo.extraConfig = mkOption {
51+ type = types.lines;
52+ default = "";
53+ description = ''
54+ Extra configuration text appended to <filename>sudoers</filename>.
55+ '';
56+ };
4957 };
5058
5159
@@ -55,7 +63,8 @@ in
5563
5664 security.sudo.configFile =
5765 ''
58− # Don't edit this file. Set the NixOS option ‘security.sudo.configFile’ instead.
66+ # Don't edit this file. Set the NixOS options ‘security.sudo.configFile’
67+ # and security.sudo.extraConfig instead.
5968
6069 # Environment variables to keep for root and %wheel.
6170 Defaults:root,%wheel env_keep+=TERMINFO_DIRS
@@ -69,6 +78,7 @@ in
6978
7079 # Users in the "wheel" group can do anything.
7180 %wheel ALL=(ALL) ${if cfg.wheelNeedsPassword then "" else "NOPASSWD: ALL, "}SETENV: ALL
81+ ${cfg.extraConfig}
7282 '';
7383
7484 security.setuidPrograms = [ "sudo" "sudoedit" ];