Run0 not working right?

I have freshly setup NixOS 24.11

Using KDE Plasma (Konsole), fish shell (stable package).

Trying to use a separate admin user or just run0 does not work.

run0 nixos-rebuild boot
run0 -u admin

In both cases, the prompt stays the same, I do not enter a shell, it us something like

user@PC [221]

Using exit closes the Konsole tab, so I do not enter a shell. Running commands with run0 instead of sudo does not seem to work.

What does NixOS do differently so that this doesnt work?

1 Like

Same problem here, but my fish prompt says the error is 224

3 Likes

I also have this issue. I also can not unlock my screen with i3lock. I think this is related.
run0 -u admin has a non-zero exit code which most likely leads to the i3lock problem.

There are 2 different solutions:

security.pam.services.systemd-run0 = {};

# alternatively

security.pam.services.systemd-user = {
   setEnvironment = true;
   pamMount = false;
}

I am not sure about the implications and which is more secure. This seems like a packaging issue, so this is a workaround I suppose