Skip to content

Commit

Permalink
Merge pull request #866 from Samasaur1/master
Browse files Browse the repository at this point in the history
security.sudo.extraConfig: init
  • Loading branch information
Enzime authored Feb 12, 2024
2 parents bdbae6e + 37eb625 commit 44f50a5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
./security/pam.nix
./security/pki
./security/sandbox
./security/sudo.nix
./system
./system/base.nix
./system/checks.nix
Expand Down
26 changes: 26 additions & 0 deletions modules/security/sudo.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ config, lib, ... }:

with lib;

let
cfg = config.security.sudo;
in
{
meta.maintainers = [
lib.maintainers.samasaur or "samasaur"
];

options = {
security.sudo.extraConfig = mkOption {
type = types.lines;
default = "";
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;
};
}

0 comments on commit 44f50a5

Please sign in to comment.