polkit: extract polkit stuff to nixos module

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

View File

@ -52,20 +52,6 @@ in
partOf = [ "graphical-session.target" ]; 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; [ environment.systemPackages = with pkgs; [
dmenu dmenu
xclip 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;
};
}