Skip to content

Commit

Permalink
Merge pull request LnL7#888 from Samasaur1/fix-sudo-extraconfig
Browse files Browse the repository at this point in the history
security.sudo.extraConfig: fix default behavior
  • Loading branch information
Enzime committed Feb 27, 2024
2 parents bbde06b + 4488831 commit 6c06334
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/security/sudo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ 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`.
'';
};
};

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;
};
};
};
}

0 comments on commit 6c06334

Please sign in to comment.