When running NixOs on WSL is it possible to change the default username? I tried changing it in /etc/nixos/configuration.nix and on rebuild and restart the boot failed with:
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.
In my instance (I used NixOS-WSL as well), I have the following in my /etc/wsl.conf (a file that ultimately links to a etc-wsl.conf entry in the nix store):
Had to revert by logging in as root with wsl -d NixOS.Dev --user root and reverting changes.
I did make a new user with useradd and adding users.user.m28k.isNormalUser = true to configuration.nix, but that new user isn’t defaulted when opening AND doesn’t have access to the windows executables when switching via sudo --login --user=m28k or login m28k as root. I need/would like that as that is how I run code file.js. I have modified my remote-extensions plugin in vscode so plugsins such as rust-analyzer work with code and rust on my nixos distro.
It’s exhausting how many “workarounds” need to be done to have NixOS work with WSL as good as UBuntu if I can be honest. A lot of hacks later, I have powerline-go working and code forwarding. Giving up on username changing whist keeping same functionality for now…
Sorry for that, I just got around to writing the rest of the docs. It should be merged pretty soon, I just wanted someone besides me to read over it before i do that