polkit: extract polkit stuff to nixos module

This commit is contained in:
Zynh Ludwig 2024-10-06 06:42:10 -07:00
parent 9fcfd13663
commit dd7c2ea7c2
3 changed files with 32 additions and 18 deletions

View file

@ -24,6 +24,7 @@
dwm.enable = true;
syncthing.enable = true;
plymouth.enable = true;
polkit.enable = true;
};
# Enable CUPS to print documents.
@ -45,8 +46,6 @@
hardware.keyboard.uhk.enable = true;
services.gnome.gnome-keyring.enable = true;
programs.dconf.enable = true;
# I think I need a gtk theme? gnome-keyring
@ -58,8 +57,6 @@
user = "ravenshade";
};
security.polkit.enable = true;
home-manager = {
users = { "ravenshade" = import ./home.nix; };
backupFileExtension = "backup";

View file

@ -52,20 +52,6 @@ in
partOf = [ "graphical-session.target" ];
};
systemd.user.services.polkit-gnome-authentication-agent = {
description = "polkit-gnome-authentication-agent";
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;
};
};
environment.systemPackages = with pkgs; [
dmenu
xclip

31
modules/polkit.nix Normal file
View file

@ -0,0 +1,31 @@
{ config, pkgs, lib, ... }:
let
cfg = config.snowhawk.polkit;
in
{
options.snowhawk.polkit = {
enable = lib.mkEnableOption "polkit nixos module";
};
config = lib.mkIf cfg.enable {
systemd.user.services.polkit-gnome-authentication-agent = {
description = "polkit-gnome-authentication-agent";
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;
};
};
security.polkit.enable = true;
# TODO: is this doing anything?
services.gnome.gnome-keyring.enable = true;
};
}