diff --git a/hosts/snowhawk/configuration.nix b/hosts/snowhawk/configuration.nix index 16a4b7d..05380cc 100644 --- a/hosts/snowhawk/configuration.nix +++ b/hosts/snowhawk/configuration.nix @@ -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"; diff --git a/modules/dwm.nix b/modules/dwm.nix index a646dde..8d5c1cd 100644 --- a/modules/dwm.nix +++ b/modules/dwm.nix @@ -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 diff --git a/modules/polkit.nix b/modules/polkit.nix new file mode 100644 index 0000000..6beeeac --- /dev/null +++ b/modules/polkit.nix @@ -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; + }; +}