!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

342 Members
https://github.com/nix-community/NixOS-WSL59 Servers

Load older messages


SenderMessageTime
18 Feb 2023
@i97henka:matrix.orghenrik-ch

I am continuing my adventures in nixos wsl and discovered something that I want to get your advice on:

This command seems to always work in PowerShell: wsl -d nixos

On the other hand, when I try and run with a specified user, like wsl -d nixos -u i97henka, it only works if I have logged in with the nixos user first.

Is that expected behaviour, or does it point at something being wrong with my setup?
Here a small PS extract:

PS C:\Users\i97he> wsl -d nixos -u i97henka <3>WSL (10) ERROR: CreateProcessEntryCommon:570: execvpe /run/current-system/sw/bin/bash failed 2 <3>WSL (10) ERROR: CreateProcessEntryCommon:579: Create process not expected to return PS C:\Users\i97he> wsl -d nixos -u i97henka

[i97henka@nixos:/mnt/c/Users/i97he]$

16:35:44
@k900:0upti.meK900Use native systemd16:36:08
@k900:0upti.meK900Don't use not native systemd16:36:20
@i97henka:matrix.orghenrik-ch *

I am continuing my adventures in nixos wsl and discovered something that I want to get your advice on:

This command seems to always work in PowerShell: wsl -d nixos

On the other hand, when I try and run with a specified user, like wsl -d nixos -u i97henka, it only works if I have logged in with the nixos user first.

Is that expected behaviour, or does it point at something being wrong with my setup?
Here a small PS extract:

PS C:\Users\i97he> wsl -d nixos -u i97henka <3>WSL (10) ERROR: CreateProcessEntryCommon:570: execvpe /run/current-system/sw/bin/bash failed 2 <3>WSL (10) ERROR: CreateProcessEntryCommon:579: Create process not expected to return PS C:\Users\i97he> wsl -d nixos -u i97henka

[i97henka@nixos:/mnt/c/Users/i97he\]$

16:37:20
@i97henka:matrix.orghenrik-ch *

I am continuing my adventures in nixos wsl and discovered something that I want to get your advice on:

This command seems to always work in PowerShell: wsl -d nixos

On the other hand, when I try and run with a specified user, like wsl -d nixos -u i97henka, it only works if I have logged in with the nixos user first.

Is that expected behaviour, or does it point at something being wrong with my setup?
Here a small PS extract:

PS C:\Users\i97he> wsl -d nixos -u i97henka
<3>WSL (10) ERROR: CreateProcessEntryCommon:570: execvpe /run/current-system/sw/bin/bash failed 2
<3>WSL (10) ERROR: CreateProcessEntryCommon:579: Create process not expected to return
PS C:\Users\i97he> wsl -d nixos -u i97henka

[i97henka@nixos:/mnt/c/Users/i97he\]$

16:38:02
@k900:0upti.meK900Can we please just drop syschdemd already, I genuinely don't care about the three people stuck on <=20H216:38:39
@i97henka:matrix.orghenrik-chThanks for reply @K900 - am I on the right track here you think? - https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/ 16:40:37
@k900:0upti.meK900No 16:40:49
@k900:0upti.meK900 Just set wsl.nativeSystemd = true in your config, rebuild, then restart your WSL VM 16:41:33
@i97henka:matrix.orghenrik-chThat works - thanks a lot 👍️🙂👍️ 🙏16:45:05
@cycyone3:matrix.orgcycyone3 changed their profile picture.17:08:58
@biswa96:matrix.orgBiswa96 joined the room.19:25:40
19 Feb 2023
@biswa96:matrix.orgBiswa96 left the room.09:10:35
@this-is-me:matrix.orgAndreas Weinzierl joined the room.23:22:46
20 Feb 2023
@i97henka:matrix.orghenrik-chDownload configuration.nix20:45:12
@i97henka:matrix.orghenrik-chI am trying to change my nixos-wsl configuration.nix to add nixvim - as described here: https://github.com/pta2002/nixvim#without-flakes what confuses me is that in the nixvim example, lib is an input, whereas in my configuration.nix it is not. As a starting point, I just added lib as an input, and that worked, but when I tried the import it failed sayint there is no lib.fetchGit function. Attached my current non-working nixos-wsl configuration.nix 20:45:18
@i97henka:matrix.orghenrik-ch * I am trying to change my nixos-wsl configuration.nix to add nixvim - as described here: https://github.com/pta2002/nixvim#without-flakes what confuses me is that in the nixvim example, lib is an input, whereas in my configuration.nix it is not. As a starting point, I just added lib as an input, and that worked, but when I tried the import it failed saying there is no lib.fetchGit function. Attached my current non-working nixos-wsl configuration.nix 20:45:44
@k900:0upti.meK900 It should probably be builtins.fetchGit or pkgs.fetchGit 20:45:46
@k900:0upti.meK900 Not lib.fetchGit 20:45:49
@i97henka:matrix.orghenrik-ch Thank you K900 , builtins is better - however, I get this error message now instead:
error: executing 'git': No such file or directory
warning: could not read HEAD ref from repo at 'https://github.com/pta2002/nixvim', using 'master'
error: executing 'git': No such file or directory
error: program 'git' failed with exit code 1
20:48:52
@k900:0upti.meK900 Do you have git installed? 20:49:04
@i97henka:matrix.orghenrik-ch which: no git in ... 🤣 20:49:47
@i97henka:matrix.orghenrik-chlet me sort that out20:49:56
@i97henka:matrix.orghenrik-ch

New configuration.nix below.
The error message I get is unexpected, at least for me:

[nixos@nixos:/etc/nixos]$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
error: The option `programs.nixvim' is used but not defined.
(use '--show-trace' to show detailed location information)
20:56:55
@i97henka:matrix.orghenrik-chDownload configuration.nix20:57:03
@i97henka:matrix.orghenrik-chI tried with the --show-trace as suggested, but I can't make much out of that stack trace. What I suspect but can't say for sure is that the inclusion in the list on row 11 in my configuration.nix throws it off, but I don't understand why that happens.20:58:44
@pta02:matrix.orgPedro Alves
In reply to @i97henka:matrix.org

New configuration.nix below.
The error message I get is unexpected, at least for me:

[nixos@nixos:/etc/nixos]$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
error: The option `programs.nixvim' is used but not defined.
(use '--show-trace' to show detailed location information)
That's an issue with nixvim
20:59:59
@pta02:matrix.orgPedro AlvesYou need to actually enable it for it to work21:00:07
@pta02:matrix.orgPedro Alves I'll fix the docs to change lib to builtins though 21:00:26
@i97henka:matrix.orghenrik-ch thank you Pedro Alves ⭐️ 21:01:47

Show newer messages


Back to Room ListRoom Version: 9