Setup polkit

This commit is contained in:
Nathan McCarty 2023-04-30 23:36:49 -04:00
parent fa50312ef7
commit 2360497a9a
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
2 changed files with 28 additions and 0 deletions

View File

@ -52,6 +52,8 @@ in with lib; {
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.wob inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.wob
# For fancy x11 scaling # For fancy x11 scaling
inputs.self.packages.${pkgs.system}.sommelier inputs.self.packages.${pkgs.system}.sommelier
# Polkit
polkit_gnome
]; ];
######################### #########################
## Sway ## Sway
@ -278,6 +280,20 @@ in with lib; {
${layman-package}/bin/layman || true ${layman-package}/bin/layman || true
''; '';
}; };
# Setup polkit as a service
systemd.user.services.polkit-gnome = {
Unit = {
Description = "Polkit gnome authentication agent";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart =
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
######################### #########################
## Mako (notifications) ## Mako (notifications)
######################### #########################

View File

@ -5,6 +5,18 @@ let
in with lib; { in with lib; {
config = mkMerge [ config = mkMerge [
{ {
security.polkit = {
enable = true;
# TODO: Refine the wheel branch to only include nessicary actions
# extraConfig = ''
# polkit.addRule(function(action, subject) {
# if (subject.isInGroup("wheel"))
# {
# return polkit.Result.YES;
# }
# })
# '';
};
environment.shells = [ pkgs.fish ]; environment.shells = [ pkgs.fish ];
users = { users = {
# If we install the user and the system is hardended, then disable mutable users # If we install the user and the system is hardended, then disable mutable users