Polkit not working in Hyprland

I am currently using Hyprland and everything works fine but while using it i tried access config.nix at vscode ,while saving it says polkit auth any suggestions to solve it

So for me it works with

  services.gnome.gnome-keyring.enable = true;
  security.pam.services.hyprland.enableGnomeKeyring = true;

Also make sure vscode is installed via Home Manager.
This will save you a lot of trouble in terms of extensions in the future

it didnt work for me any other option

So try:

security.polkit.enable=true;

install libsForQt5.polkit-kde-agent in your system enviroment packages and finally add "systemctl --user start plasma-polkit-agent" in your hyprland exec-once.
For the problem with VS code there are more than one solutions.

  1. (not recommended) chown the directory so your user has privileges there.
  2. make an etc directory in your home directory and link it to /etc/nixos:
mkdir ~/etc
sudo mv /etc/nixos ~/etc/
sudo chown -R $(id -un):users ~/etc/nixos
sudo ln -s ~/etc/nixos /etc/

#code ~/etc/nixos/
codium ~/etc/nixos/
  1. edit your configuration in your home directory. For rebuilding enter this command to rebuild from a different directory nixos-rebuild switch -I nixos-config=$HOME/etc/nixos/configuration.nix.

For me the auth. agent works for example when using gparted. But for VS code it does not.
So the solutions mentioned before are best suited.

this worked thanks and alse i tried this which also worked

#Polkit agent
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = “polkit-gnome-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;
};
};
};

1 Like