mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-16 22:49:25 +03:00
nixos/sudo: Don't include empty sections
This makes the generated sudoers a touch easier to read.
This commit is contained in:
parent
409d29ca73
commit
454151375d
1 changed files with 6 additions and 6 deletions
|
@ -205,7 +205,7 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
security.sudo.configFile = concatStringsSep "\n" [
|
security.sudo.configFile = concatStringsSep "\n" (filter (s: s != "") [
|
||||||
''
|
''
|
||||||
# Don't edit this file. Set the NixOS options ‘security.sudo.configFile’
|
# Don't edit this file. Set the NixOS options ‘security.sudo.configFile’
|
||||||
# or ‘security.sudo.extraRules’ instead.
|
# or ‘security.sudo.extraRules’ instead.
|
||||||
|
@ -218,7 +218,7 @@ in
|
||||||
# "root" is allowed to do anything.
|
# "root" is allowed to do anything.
|
||||||
root ALL=(ALL:ALL) SETENV: ALL
|
root ALL=(ALL:ALL) SETENV: ALL
|
||||||
''
|
''
|
||||||
''
|
(optionalString (cfg.extraRules != []) ''
|
||||||
# extraRules
|
# extraRules
|
||||||
${concatStringsSep "\n" (
|
${concatStringsSep "\n" (
|
||||||
lists.flatten (
|
lists.flatten (
|
||||||
|
@ -230,12 +230,12 @@ in
|
||||||
) cfg.extraRules
|
) cfg.extraRules
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
''
|
'')
|
||||||
''
|
(optionalString (cfg.extraConfig != "") ''
|
||||||
# extraConfig
|
# extraConfig
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
''
|
'')
|
||||||
];
|
]);
|
||||||
|
|
||||||
security.wrappers = let
|
security.wrappers = let
|
||||||
owner = "root";
|
owner = "root";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue