nixos/modules/polkit.nix

32 lines
822 B
Nix

{ config, pkgs, lib, ... }:
let
cfg = config.snowhawk.polkit;
in
{
options.snowhawk.polkit = {
enable = lib.mkEnableOption "polkit nixos module";
};
config = lib.mkIf cfg.enable {
systemd.user.services.polkit-gnome-authentication-agent = {
description = "polkit-gnome-authentication-agent";
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;
};
};
security.polkit.enable = true;
# TODO: is this doing anything?
services.gnome.gnome-keyring.enable = true;
};
}