My NixOS config has the following passage, which used to work:
users.users.jeff = {
uid = 1000; # for compatibility with Ubuntu
isNormalUser = true;
extraGroups = [
... # I'm skipping some stuff here
];
};
I just upgraded from Plasma 5 to 6 (also declaratively via NixOS), and now my UID appears to have reverted to 1001:
jeff 2025-03-25 18:37:23 ~$ id
uid=1001(jeff) gid=100(users) groups=100(users),1(wheel),17(audio),27(dialout),57(networkmanager),131(docker)
jeff 2025-03-25 18:37:26 ~$
My config does not mention users.mutableUsers. I tried setting that to false, NixOS refused to compile with a scary message, and I backed off:
jeff 2025-03-25 18:42:25 ~/nix/jbb$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
error:
… while calling the 'head' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1:35741:
… while evaluating the attribute 'value'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:33591:
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix'
:
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error:
Failed assertions:
- Neither the root account nor any wheel user has a password or SSH authorized key.
You must set one to prevent being locked out of your system.
If you really want to be locked out of your system, set users.allowNoPasswordLogin = true;
However you are most probably better off by setting users.mutableUsers = true; and
manually running passwd root to set the root password.
Any ideas?