nix/module/Polkit.nix

35 lines
692 B
Nix
Raw Normal View History

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