`su` does not work in`nixos-enter`: Authentication service cannot retrieve authentication info

Basically the same issue as this. After running nixos-install, I clone some Git repos in my $HOME and I also want to enable Home Manager for my user. But, chroot-ing inside my brand new install with nixos-enter and running su does not work.

[nixos@nixos:~]$ sudo nixos-enter
setting up /etc...
bash: warning: setlocale: LC_NUMERIC: cannot change locale (ro_RO.UTF-8): No such file or directory
bash: warning: setlocale: LC_TIME: cannot change locale (ro_RO.UTF-8): No such file or directory

[root@nixos:/]# su
su: command not found

[root@nixos:/]# export PATH=/nix/var/nix/profiles/system/sw/sbin/:/nix/var/nix/profiles/system/sw/bin/:$PATH

[root@nixos:/]# su
su: Authentication service cannot retrieve authentication info
(Ignored)
Cannot execute /run/current-system/sw/bin/bash: No such file or directory

[root@nixos:/]#

By the way, ignore I need to manually set $PATH, that’s another issue I found, but at least I worked around it.

So, what to do?

1 Like