Fix NixOS polkit rule for defaulting to current user upon password request #288

Open
opened 2026-01-16 20:44:39 +01:00 by oysteikt · 5 comments
Owner

There is a polkit rule in place that is supposed to choose which user should write the password upon actions like sudo - without this, polkit will first ask who in the list of wheel users you want to enter the password for (which is slightly annoying, especially when the numbers change). But this rule does not work as intended. You can find it in the base directory in the pvv nixos config.

See also: https://superuser.com/questions/1312042/is-there-a-way-to-make-the-polkit-agent-default-to-the-currently-logged-in-user

There is a polkit rule in place that is supposed to choose which user should write the password upon actions like `sudo` - without this, polkit will first ask who in the list of `wheel` users you want to enter the password for (which is slightly annoying, especially when the numbers change). But this rule does not work as intended. You can find it in the `base` directory in the pvv nixos config. See also: https://superuser.com/questions/1312042/is-there-a-way-to-make-the-polkit-agent-default-to-the-currently-logged-in-user
oysteikt added the bugnixos labels 2026-01-16 20:44:39 +01:00
oysteikt added this to the Kanban project 2026-01-16 20:44:39 +01:00
oysteikt moved this to Low priority in Kanban on 2026-01-16 20:44:48 +01:00
Owner

w-what?

w-what?
Author
Owner
[oysteikt@bekkalokk:~]$ systemctl restart nginx
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
Authentication is required to restart 'nginx.service'.
Multiple identities can be used for authentication:
 1.  (0_0) (adriangl)
 2.  albertba
 3.  alfhj
 4.  amalieem
 5.  danio
 6.  eirikwit
 7.  felixalb
 8.  frero
 9.  jonmro
 10.  basement dweller (oysteikt)
 11.  kul kis (pederbs)
 12.  noe (vegardbm)
Choose identity to authenticate as (1-12):

why would it ask me this if it knows I'm oysteikt lmao

``` [oysteikt@bekkalokk:~]$ systemctl restart nginx ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ==== Authentication is required to restart 'nginx.service'. Multiple identities can be used for authentication: 1. (0_0) (adriangl) 2. albertba 3. alfhj 4. amalieem 5. danio 6. eirikwit 7. felixalb 8. frero 9. jonmro 10. basement dweller (oysteikt) 11. kul kis (pederbs) 12. noe (vegardbm) Choose identity to authenticate as (1-12): ``` why would it ask me this if it knows I'm `oysteikt` lmao
Author
Owner

There's seemingly an option security.polkit.adminIdentities that might fix this

There's seemingly an option `security.polkit.adminIdentities` that might fix this
Author
Owner

There's seemingly an option security.polkit.adminIdentities that might fix this

Tried this, apparently it just doubles all the users...

> There's seemingly an option `security.polkit.adminIdentities` that might fix this Tried this, apparently it just doubles all the users...
Owner

hahahaha

hahahaha
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Drift/issues#288