mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
polkit-gnome: init module
This commit is contained in:
committed by
Austin Horstman
parent
5503a758f9
commit
29c6f2b0cb
@@ -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
|
||||
|
||||
32
modules/services/polkit-gnome.nix
Normal file
32
modules/services/polkit-gnome.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
|
||||
23
tests/modules/services/polkit-gnome/basic-configuration.nix
Normal file
23
tests/modules/services/polkit-gnome/basic-configuration.nix
Normal 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
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
||||
1
tests/modules/services/polkit-gnome/default.nix
Normal file
1
tests/modules/services/polkit-gnome/default.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ polkit-gnome-basic-configuration = ./basic-configuration.nix; }
|
||||
Reference in New Issue
Block a user