I am newwwwww to Nixos, so I tried to install NIxos in vmware. And vscode is installed through configuration.nix:
# softmware
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
};
};
};
environment.sessionVariables.NIXOS_OZONE_WL = "1"; # to use vscode under wayland
environment.systemPackages = with pkgs; [
...
vscode.fhs
...
]
The installation is successful, but vscode just canβt be launched. Meanwhile, google-chrome, microsoft-edge, all they canβt be launched. Then, I installed chromium and electron. Still failed.
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.
Ah, looking closer, I believe the problem is that youβre using vscode.fhsβ¦ I think thatβs an internal derivation thatβs part of how vscode is packaged. You probably meant vscode-fhs.
EDIT: Scratch that. Theyβre the same package according to all-packages.nix.
β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?
Because I just use it in virtual machine for test. And no core data on it. So I want to login with all rights, and even more I donβt want to input password every time for login.
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.