1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 08:17:01 +00:00

Merge pull request #888 from Samasaur1/fix-sudo-extraconfig

security.sudo.extraConfig: fix default behavior
This commit is contained in:
Michael Hoang 2024-02-27 13:37:32 +11:00 committed by GitHub
commit 6c06334f08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,8 +12,8 @@ in
options = {
security.sudo.extraConfig = mkOption {
type = types.lines;
default = "";
type = types.nullOr types.lines;
default = null;
description = mdDoc ''
Extra configuration text appended to {file}`sudoers`.
'';
@ -21,6 +21,10 @@ in
};
config = {
environment.etc."sudoers.d/10-nix-darwin-extra-config".text = lib.mkIf (cfg.extraConfig != "") cfg.extraConfig;
environment.etc = {
"sudoers.d/10-nix-darwin-extra-config" = mkIf (cfg.extraConfig != null) {
text = cfg.extraConfig;
};
};
};
}