Struggled too a bit, here some additional pointers for those brave enough to follow the low-level approach:
- nixos-rebuild does not apply UID/GID change when mutableUsers = false · Issue #12170 · NixOS/nixpkgs · GitHub
find / \( -path /mnt -o -path /sys -o -path /proc \) -prune -o -uid ***
- https://www.thegeekdiary.com/how-to-correctly-change-the-uid-and-gid-of-a-user-group-in-linux/
- linux - How do I exclude a directory when using `find`? - Stack Overflow
Personally I’ll stick using nixos
user in NixOS-WSL for now, i. e. I had no systemd-tmpfiles or similar configured and thus permissions were always a mess when restarting the VM while using a different user.