1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-31 04:04:32 +00:00

polkit-gnome: init module

This commit is contained in:
Bob van der Linden 2025-03-14 22:49:29 +01:00 committed by Austin Horstman
parent 5503a758f9
commit 29c6f2b0cb
5 changed files with 58 additions and 0 deletions

View file

@ -379,6 +379,7 @@ let
./services/playerctld.nix
./services/plex-mpv-shim.nix
./services/podman-linux
./services/polkit-gnome.nix
./services/polybar.nix
./services/poweralertd.nix
./services/psd.nix

View file

@ -0,0 +1,32 @@
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption mkPackageOption types literalExpression 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-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart =
"${cfg.package}/libexec/polkit-gnome-authentication-agent-1";
};
};
};
}

View file

@ -527,6 +527,7 @@ in import nmtSrc {
./modules/services/picom
./modules/services/playerctld
./modules/services/podman-linux
./modules/services/polkit-gnome
./modules/services/polybar
./modules/services/recoll
./modules/services/redshift-gammastep

View file

@ -0,0 +1,23 @@
{
services.polkit-gnome.enable = true;
nmt.script = ''
clientServiceFile=home-files/.config/systemd/user/polkit-gnome.service
assertFileExists $clientServiceFile
assertFileContent $clientServiceFile ${
builtins.toFile "expected.service" ''
[Install]
WantedBy=graphical-session.target
[Service]
ExecStart=@polkit-gnome@/libexec/polkit-gnome-authentication-agent-1
[Unit]
After=graphical-session-pre.target
Description=GNOME PolicyKit Agent
PartOf=graphical-session.target
''
}
'';
}

View file

@ -0,0 +1 @@
{ polkit-gnome-basic-configuration = ./basic-configuration.nix; }