!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

347 Members
https://github.com/nix-community/NixOS-WSL61 Servers

Load older messages


SenderMessageTime
9 Feb 2023
@k900:0upti.meK900I just randomly stumbled upon this in a completely unrelated codebase21:59:24
@k900:0upti.meK900Now I need to fix the shim21:59:39
@k900:0upti.meK900https://github.com/nix-community/NixOS-WSL/pull/219/files22:41:05
@k900:0upti.meK900Started fixing the shim22:41:08
@k900:0upti.meK900Don't merge until I get tests running in CI though22:41:23
10 Feb 2023
@hexagony:mozilla.orghexagony joined the room.02:05:29
@k900:0upti.meK900https://github.com/nix-community/NixOS-WSL/pull/219 should be good to review now07:26:05
11 Feb 2023
@k900:0upti.meK900I merged 219 because I found a setup where the old one actually breaks14:40:17
12 Feb 2023
@i97henka:matrix.orghenrik-ch

I am very new to nixos, nixos wsl, and also to this channel. I hope that it's okay to post here to ask for your advice.
I added this snippet to my /etc/nixos/configuration.nix

environment.systemPackages = with pkgs; [
    emacs
  ];

(I put it under the experimental features flakes bit)

When I ran nixos-rebuild switch afterwards I get this error message:

building '/nix/store/51a2g3iffr4cv3wzh1k9g69231ldv8gj-etc.drv'...
building '/nix/store/p4c000pm7qzlmn2a72gnxfrkdvccdlbz-nixos-system-nixos-22.05.20220812.5c211b4.drv'...
error: creating symlink from '/nix/var/nix/profiles/system-2-link.tmp-6530-1022011929' to '/nix/store/wpirs5md50yzp3qws0chzpqr5s3jzfaf-nixos-system-nixos-22.05.20220812.5c211b4': Permission denied

then I try sudo nixos-rebuild switch and still get an error.

reloading user units for nixos...
setting up tmpfiles
fchmod() of /tmp/.X11-unix failed: Read-only file system
reloading the following units: dbus.service

Any pointers to what might be best next steps or things to check would be greatly appreciated!

19:59:08
@k900:0upti.meK900You should probably update your nixos-wsl version20:00:20
@k900:0upti.meK900 And then run nixos-rebuild with sudo 20:00:38
@i97henka:matrix.orghenrik-ch Thank you for chatting back K900 🙏. Are you thinking of system.stateVersion = "22.05";, or more like downloading a new tar.gz? 20:02:15
@k900:0upti.meK900 Never touch stateVersion 20:02:22
@k900:0upti.meK900Did you use the official tarball from the NixOS-WSL github page?20:02:51
@i97henka:matrix.orghenrik-chI think so, but just to make sure, I will start afresh, it's a quick thing to do.20:03:13
@k900:0upti.meK900Which tarball version did you use? The 22.05 one from releases?20:04:20
@k900:0upti.meK900Try the latest build from CI: https://github.com/nix-community/NixOS-WSL/actions/runs/415182971620:04:46
@i97henka:matrix.orghenrik-ch Thank you for the advice - will do!
What you mean for afterwards is basically installing as is, and then run the sudo nixos-rebuild without making any changes, to configuration.nix, right?
20:05:20
@i97henka:matrix.orghenrik-ch * Thank you for the advice - will do!
What you mean for afterwards is basically installing as is, and then run the sudo nixos-rebuild without making any changes to configuration.nix, right?
20:05:41
@k900:0upti.meK900Just install from that latest build20:05:50
@k900:0upti.meK900 And then sudo nixos-rebuild switch when you want to make changes 20:05:58
@i97henka:matrix.orghenrik-ch

Installed like this:
PS C:\Users\i97he> wsl --import NixOS .\NixOS\ installer.zip --version 2

then I run and get this error:

PS C:\Users\i97he> wsl --shutdown
PS C:\Users\i97he> wsl -d NixOS
Processing fstab with mount -a failed.

<3>WSL (8) ERROR: CreateProcessEntryCommon:358: getpwuid(0) failed 2
<3>WSL (8) ERROR: CreateProcessEntryCommon:362: getpwuid(0) failed 2
<3>WSL (8) ERROR: CreateProcessEntryCommon:570: execvpe /bin/sh failed 2
<3>WSL (8) ERROR: CreateProcessEntryCommon:579: Create process not expected to return
PS C:\Users\i97he>
20:13:35
@k900:0upti.meK900You need to unzip the installer.zip to actually get the install image20:14:53
@nzbr:nzbr.deArson Copperflame There should be a .tar.gz inside that zip, you need to use that instead of the zip directly 20:14:53
@k900:0upti.meK900Why does it even work the other way20:15:03
@i97henka:matrix.orghenrik-chSorry to waste your time with my rookie mistakes, and thanks for your patience!20:15:51
@i97henka:matrix.orghenrik-chtrying now20:15:55
@nzbr:nzbr.deArson Copperflame
In reply to @k900:0upti.me
Why does it even work the other way
Because WSL can actually use zips, but then you get a system with the tarball as the only file (and that won't boot obviously). And because this is a MS-Product, the error message does not give any clue to what is actually happening
20:16:43
@k900:0upti.meK900Should just ship a squashfs20:17:07
@k900:0upti.meK900/s20:17:23

Show newer messages


Back to Room ListRoom Version: 9