Factor out polkit

This commit is contained in:
Nathan McCarty 2023-06-20 02:12:49 -04:00
parent bc315d4785
commit 2dc5e60d16
Signed by: thatonelutenist
SSH Key Fingerprint: SHA256:hwQEcmak9E6sdU9bXc98RHw/Xd1AhpB5HZT7ZSVJkRM
2 changed files with 21 additions and 16 deletions

View File

@ -0,0 +1,21 @@
{ config, lib, pkgs, ... }:
let
hyprland = config.nathan.programs.hyprland.enable;
targets = config.nathan.config.desktop.targets;
in lib.mkif hyprland {
home.packages = with pkgs; [ libsForQt5.polkit-kde-agent ];
# Setup polkit as a service
systemd.user.services.polkit-kde = {
Unit = {
Description = "Polkit kde authentication agent";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart =
"${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
Restart = "on-failure";
};
Install = { WantedBy = targets; };
};
}

View File

@ -41,8 +41,6 @@ in with lib; {
inputs.self.packages.${pkgs.system}.pyprland
# For fancy x11 scaling
sommelier
# Polkit
libsForQt5.polkit-kde-agent
# Auto workspace renaming
inputs.self.packages.${pkgs.system}.hyprland-autoname-workspaces
];
@ -256,20 +254,6 @@ in with lib; {
#########################
## Hyprland Addons
#########################
# Setup polkit as a service
systemd.user.services.polkit-kde = {
Unit = {
Description = "Polkit kde authentication agent";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart =
"${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
Restart = "on-failure";
};
Install = { WantedBy = [ "hyprland-session.target" ]; };
};
# Setup swayosd as a service
systemd.user.services.swayosd = {
Unit = {