aboutsummaryrefslogtreecommitdiff
path: root/modules/services/polkit.nix
blob: abd050ffaf22185d4b9190bfa47d96e1d9227e6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
  config,
  pkgs,
  lib,
  ...
}:
{
  options.nx.services.polkit.enable = lib.mkEnableOption "Enable and setup polkit service";
  config = lib.mkIf config.nx.services.polkit.enable {
    environment.systemPackages = with pkgs; [
      polkit
      polkit_gnome
    ];
    security.polkit.enable = true;
    systemd.user.services.polkit-gnome-authentication-agent-1 = {
      description = "polkit-gnome-authentication-agent-1";
      wantedBy = [ "graphical-session.target" ];
      wants = [ "graphical-session.target" ];
      after = [ "graphical-session.target" ];
      serviceConfig = {
        Type = "simple";
        ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
        Restart = "on-failure";
        RestartSec = 1;
        TimeoutStopSec = 10;
      };
    };
  };
}