nix/module/Polkit.nix

34 lines
626 B
Nix
Raw Normal View History

# Polkit agent is used by apps to ask for Root password with a popup.
{
2024-11-04 04:37:29 +03:00
config,
lib,
pkgs,
...
}: let
2024-11-07 12:12:53 +03:00
cfg = config.module.polkit;
2024-11-04 04:37:29 +03:00
in {
2024-11-07 12:12:53 +03:00
options.module.polkit.enable = lib.mkEnableOption "the polkit.";
2024-06-25 04:04:39 +03:00
2024-11-04 04:37:29 +03:00
config = lib.mkIf cfg.enable {
security.polkit.enable = true;
systemd = {
packages = with pkgs; [
polkit-kde-agent
];
user = {
services.plasma-polkit-agent = {
environment.PATH = lib.mkForce null;
serviceConfig = {
Restart = "always";
RestartSec = 2;
Slice = "session.slice";
};
wantedBy = [
"gui-session.target"
];
};
};
};
};
2024-03-29 14:06:51 +03:00
}