-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nix daemon default allowed_users not working with wsl update #549
Comments
Are you on nixos-unstable? Do you have nix.settings.trusted-users or nix.settings.allowed-users set in your config? Could it be that you need to adapt your config because of https://redirect.github.com/NixOS/nixpkgs/pull/318635 ? |
I've realized this is a little more complicated. I have the exact same flake installed on two wsl systems, my work laptop and my desktop. My laptop is fine. But, dandomly I will need to rerun rebuild switch on my desktop wsl instance before my user will be able to connect to the daemon. I have confirmed my user id is always 1000, and I have allowed users and trusted users both set to [ "*" "@users" ] I don't really have any idea what is going on, because I don't really know how the nix daemon auth works... |
I had the same issue once, but I think I restarted the nix-daemon service and it started working just fine. |
What is |
I am having the exact same issue but I am also no longer able to rebuild the system.
it says When trying to rebuild I get the following
|
This just happened again. The config shown while broken attached: wsl_config_10.10.24.txt
|
After reboot the nix-shell command as normal user does no longer give the response error: Same response with |
You can try these commands:
Change the username and shell according to your configuration. I didn't have your issue per se, but these commands help solve a lot of other issues I had with NixOS-WSL. You have to run them each time you want to start NixOS in WSL though |
Thanks, but it did not solve my issue. The configuration also stoped beeing able to be build inside my forgejo actions ci/cd pipeline, where the build abruptly fails with:
|
I've also needed to restart the nix daemon to be able to connect to it a few times in the last few weeks and I'm on stable (24.05) so there's a good chance this happens because microsoft changed something. Haven't touched allowed/trusted users at all |
This problem is very random, but since disabling cgroupsv1 for wsl for other reasons I have not experienced this again. I will edit here if the problem comes back even with forced cgroupsv2. |
I just updated a bunch of windows stuff, including to WSL 2.2.4.0:
And my previously working nix config, as well as updating to the current commit (WSL cc84991 and nixpkgs c04d5652) now no longer lets me run nix commands without sudo, with the error
error: cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Connection refused
I don't know what would be causing this, but adding
nix.settings.allowed_users = [ "@users" ];
fixes the issue. The default "*" does not work for some reason.The text was updated successfully, but these errors were encountered: