diff --git a/home/modules/desktop/default.nix b/home/modules/desktop/default.nix index 4ef7ccc..c2584f9 100644 --- a/home/modules/desktop/default.nix +++ b/home/modules/desktop/default.nix @@ -1,15 +1,13 @@ { imports = [ - # ./themeSettings # done ./browser # done -- firefox still need: chrome, brave ./creative ./communication # only discord implemented ./media # done -- spotify gui still needs to be implemented ./terminal # done -- wezterm still needs to be implemented - #./wallpaper -- still needs to be implemented - #./utility -- still needs to be implemented ./wayland # -- almost done, need to implement eww ./productivity ./gaming + ./security ]; } diff --git a/home/modules/desktop/security/default.nix b/home/modules/desktop/security/default.nix new file mode 100644 index 0000000..5e3aa78 --- /dev/null +++ b/home/modules/desktop/security/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./polkit + ]; +} diff --git a/home/modules/desktop/security/polkit/default.nix b/home/modules/desktop/security/polkit/default.nix new file mode 100644 index 0000000..083aff0 --- /dev/null +++ b/home/modules/desktop/security/polkit/default.nix @@ -0,0 +1,46 @@ +{ lib, config, pkgs, ... }: + +let + inherit (lib) mkIf types mkOption; + inherit (builtins) elem; + cfg = config.homeModules.security.polkit; +in + +{ + options.homeModules.security.polkit = mkOption { + type = types.enum ["gnome" "pantheon"]; # TODO: add kde agent + default = ""; + description = "Type of polkit agent module to use"; + }; + + config = { + systemd.user.services = { + polkit-pantheon-authentication-agent-1 = mkIf (elem cfg ["pantheon"]) { + description = "polkit-pantheon-authentication-agent-1"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.pantheon.pantheon-agent-polkit}/libexec/policykit-1-pantheon/io.elementary.desktop.agent-polkit"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + polkit-gnome-authentication-agent-1 = mkIf (elem cfg ["gnome"]) { + description = "polkit-pantheon-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; + }; + }; + }; + }; +} diff --git a/home/profile/hyprland/default.nix b/home/profile/hyprland/default.nix index 9dc6c34..a86cfbd 100644 --- a/home/profile/hyprland/default.nix +++ b/home/profile/hyprland/default.nix @@ -30,6 +30,8 @@ in }; }; + security.polkit = "pantheon"; + communication = { discord.enable = true; };