mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
Create polkit-gnome.nix
This commit is contained in:
parent
f9381b8364
commit
a0e3efd95d
1 changed files with 35 additions and 0 deletions
35
modules/services/polkit-gnome.nix
Normal file
35
modules/services/polkit-gnome.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkIf mkEnableOption mkOption mkPackageOption;
|
||||||
|
cfg = config.services.polkit-gnome;
|
||||||
|
in {
|
||||||
|
meta.maintainers = []; # TODO: add maintainer
|
||||||
|
|
||||||
|
options.services.polkit-gnome = {
|
||||||
|
enable = mkEnableOption "polkit-gnome";
|
||||||
|
package = mkPackageOption pkgs "polkit_gnome"; # TODO: make it global
|
||||||
|
systemd = mkEnableOption "systemd service for polkit-gnome" // mkOption {default = true;};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.user = mkIf cfg.systemd {
|
||||||
|
services.polkit-gnome-authentication-agent-1 = {
|
||||||
|
description = "polkit-gnome-authentication-agent-1";
|
||||||
|
wantedBy = ["graphical-session.target"];
|
||||||
|
wants = ["graphical-session.target"];
|
||||||
|
after = ["graphical-session.target"];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 1;
|
||||||
|
TimeoutStopSec = 10;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue