nix/module/desktop/Polkit.nix

29 lines
631 B
Nix
Raw Normal View History

# Polkit agent is used by apps to ask for Root password with a popup.
2024-06-25 04:04:39 +03:00
{ pkgs, lib, config, ... }: with lib; let
cfg = config.module.desktop.polkit;
in {
options = {
module.desktop.polkit.enable = mkEnableOption "Polkit.";
};
config = mkIf cfg.enable {
security.polkit.enable = true;
systemd = {
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-30 04:23:29 +03:00
};
};
};
};
2024-03-29 14:06:51 +03:00
}