2.home-manager/modules/services/polkit-gnome.nix
Lyndon Sanche f5b12be834
polkit-gnome: Change After target (#7137)
Before this change, I was getting `cannot open display:` errors
2025-05-27 19:14:03 -05:00

43 lines
836 B
Nix

{
config,
lib,
pkgs,
...
}:
let
inherit (lib)
mkEnableOption
mkPackageOption
mkIf
maintainers
;
cfg = config.services.polkit-gnome;
in
{
meta.maintainers = [ maintainers.bobvanderlinden ];
options = {
services.polkit-gnome = {
enable = mkEnableOption "GNOME Policykit Agent";
package = mkPackageOption pkgs "polkit_gnome" { };
};
};
config = mkIf cfg.enable {
systemd.user.services.polkit-gnome = {
Unit = {
Description = "GNOME PolicyKit Agent";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${cfg.package}/libexec/polkit-gnome-authentication-agent-1";
};
};
};
}