From bb326be2aad0a67612fbffa80ec754b99b67a5e1 Mon Sep 17 00:00:00 2001 From: ooks-io Date: Sun, 5 May 2024 22:53:39 +1200 Subject: [PATCH] fix(homeModules:polkit): syntax --- .../desktop/security/polkit/default.nix | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/home/modules/desktop/security/polkit/default.nix b/home/modules/desktop/security/polkit/default.nix index 083aff0..8bd661f 100644 --- a/home/modules/desktop/security/polkit/default.nix +++ b/home/modules/desktop/security/polkit/default.nix @@ -3,11 +3,11 @@ let inherit (lib) mkIf types mkOption; inherit (builtins) elem; - cfg = config.homeModules.security.polkit; + cfg = config.homeModules.desktop.security.polkit; in { - options.homeModules.security.polkit = mkOption { + options.homeModules.desktop.security.polkit = mkOption { type = types.enum ["gnome" "pantheon"]; # TODO: add kde agent default = ""; description = "Type of polkit agent module to use"; @@ -16,11 +16,15 @@ in config = { systemd.user.services = { polkit-pantheon-authentication-agent-1 = mkIf (elem cfg ["pantheon"]) { - description = "polkit-pantheon-authentication-agent-1"; - wantedBy = [ "graphical-session.target" ]; - wants = [ "graphical-session.target" ]; - after = [ "graphical-session.target" ]; - serviceConfig = { + Unit.Description = "polkit-pantheon-authentication-agent-1"; + + Install = { + WantedBy = [ "graphical-session.target" ]; + Wants = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { Type = "simple"; ExecStart = "${pkgs.pantheon.pantheon-agent-polkit}/libexec/policykit-1-pantheon/io.elementary.desktop.agent-polkit"; Restart = "on-failure"; @@ -28,12 +32,16 @@ in TimeoutStopSec = 10; }; }; + polkit-gnome-authentication-agent-1 = mkIf (elem cfg ["gnome"]) { - description = "polkit-pantheon-authentication-agent-1"; - wantedBy = [ "graphical-session.target" ]; - wants = [ "graphical-session.target" ]; - after = [ "graphical-session.target" ]; - serviceConfig = { + Unit.Description = "polkit-pantheon-authentication-agent-1"; + Install = { + WantedBy = [ "graphical-session.target" ]; + Wants = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { Type = "simple"; ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; Restart = "on-failure";