Ordinarily I believe there are 2 ways to launch it:
the regular way for a desktop application, i.e. in Gnome one can hit super, type the app name, and hit enter, or browse to it from an application launcher menu
in the terminal emulator, one can use the launcher command code
Both methods might not work without a reboot. I don’t know which distributions automatically expose the code command on the $PATH, or which require the user to source it themselves. Curious what NixOS does.
“can’t be launched” refers to the app has no reflection, no UI pop up when clicking the app icon. The weird thing happened both for vscode, chrome, ande microsoft-edge. But everything is ok with firefox.
Since these 3 apps all using chromium, so I wonder if there is some setting I am missing with chromium?
So give your user no password and give them sudo privileges. That’s not going to break so many expectations.
Running gui programs as root is the sort of thing some developers specifically sabotage, just because they believe nobody should ever be doing it, period. That seems to be the case with chromium/electron, and I wouldn’t be surprised if there are others that do the same.
But still, when restart after nixos-rebuild switch && reboot, I am stopped by the login UI, if input nothing and press ENTER directly, it would tell me I have the wrong password number.
I’ve also tried to use isNormalUser = true;, but nothing changed.
(Actually, I’ve tried to install NIXOS without setting root password by nixos-install --no-root-passwd, then I can’t login anylonger, so I have to reinstall system with a root password.)
Nothing you did here sets your user password to an empty string, like I suggested.
Also, your login user should definitely have isNormalUser set to true, and you don’t really need to create a group for your user unless you really want that for some reason. The default setup is to have all the normal users belong to the users group.
Also, I’m not certain, but I think sudo may not need to be configured for passwordless use if your user’s password is empty already.
But still failed to log in. If I check passwd -S dong, it feeds back with dong L 1970-01-02 -1 -1 -1 -1, which implies that the user password is locked. And it is illegal to set empty password by passwd dong.
So now, I am really at a loss on how to create a user without password.
This is the system info:
It logs into an xterm session automatically with no prompt, and does sudo without a password prompt at all. I can also login to a tty by just typing the username and pressing enter at the password prompt.