about summary refs log tree commit diff
path: root/modules/common/security.nix
blob: acfc9cc632d74840527ddbe1bff8d15dbf9d4b9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
_: {
  security = {
    sudo.wheelNeedsPassword = false;

    polkit = {
      enable = true;
      extraConfig = ''
        /*
         * Allow members of the wheel group to execute any actions
         * without password authentication, similar to "sudo NOPASSWD:".
         *
         * https://wiki.archlinux.org/title/Polkit#Bypass_password_prompt
         */
        polkit.addRule(function(action, subject) {
          if (subject.isInGroup('wheel'))
            return polkit.Result.YES;
        });
      '';
    };
  };
}

Consider giving Nix/NixOS a try! <3