1
1
Fork 0
nixos/options/custom/settings/security.nix
Myned 53c8575116
git: migrate to forgejo
Squashes 1,331 commits

Signed-off-by: Myned <dev@bjork.tech>
2024-09-12 19:41:21 -05:00

29 lines
651 B
Nix

{ config, lib, ... }:
with lib;
let
cfg = config.custom.settings.security;
in
{
options.custom.settings.security.enable = mkOption { default = false; };
config = mkIf cfg.enable {
# Bypass password prompts
security = {
sudo.wheelNeedsPassword = false;
# https://wiki.nixos.org/wiki/Sway#Using_Home_Manager
polkit = {
enable = true;
# https://wiki.archlinux.org/title/Polkit#Bypass_password_prompt
extraConfig = ''
polkit.addRule(function(action, subject) {
if (subject.isInGroup("wheel")) { return polkit.Result.YES; }
});
'';
};
};
};
}