1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Merge pull request #866 from Samasaur1/master

security.sudo.extraConfig: init
This commit is contained in:
Michael Hoang 2024-02-12 13:08:09 +10:00 committed by GitHub
commit 44f50a5eca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 0 deletions

View file

@ -7,6 +7,7 @@
./security/pam.nix
./security/pki
./security/sandbox
./security/sudo.nix
./system
./system/base.nix
./system/checks.nix

26
modules/security/sudo.nix Normal file
View file

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