Cannot enable polkit

Hello,

I wasn’t able to find any information about this specific issues, but whenever I set security.polkit.enable to true and try to rebuild my config I get the following error:

error:

attribute ‘bin’ missing at

/nix/store/anvdcc2arw7kqrvwnidvhw6ypkkvws68-source/nixos/modules/security/polkit.nix:131:19 :

      130|       group = "root";
      131|       source = "${cfg.package.bin}/bin/pkexec";
         |                  **^**
      132|     };

I’m on NixOs 25.11 Unstable, I don’t have any overlays set up

I’m not sure what additional information I could include at the moment, so hopefully this is enough for now.

What do you have for security.polkit.paclage?

I tried two with the same results:
kdePackages.polkit-kde-agent-1 and hyprpolkitagent

Neither of those are implementations of polkit, use the default package (i.e., simply don’t set the package).

The agent should be configured by your desktop environment; if you’re using KDE you don’t need to do anything else, it’s set up by default. I don’t know about hyprland and generally don’t help people with that project.

1 Like

I use hyprland, and dont set the package either. Polkit works just fine for me.

1 Like

Thank you! Removing the package parameter worked like a charm.

I returned to NixOS after a while, because I missed the declarativity of it so I just used my old config where I had the package set.

I’m no way proficient in Nix, so I guess I just assumed that package is needed. And because it worked in my old config, I was confused why it is not working now.

yes I’m also using hyprland, and setting up package worked in my old config.

So no package works as expected.