errors during install on wsl2 nixos #32

Open
opened 2024-05-28 02:12:38 +00:00 by sls · 2 comments
sls commented 2024-05-28 02:12:38 +00:00 (Migrated from github.com)

I understand that this is a niche use case, but I want to document my results here for whatever benefit it may have. This WSL2 instance is a vanilla nixos stable:

$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-23.11
nixos-wsl https://github.com/nix-community/NixOS-WSL/archive/refs/heads/main.tar.gz

Following the description in https://github.com/auxolotl/templates "Getting Started" / "With Nixos", at the step:
$ nixos-generate-config --show-hardware-config > hardware-configuration.nix
the system responds with these errors:

ERROR: Not a Btrfs filesystem: Invalid argument
ERROR: Not a Btrfs filesystem: Invalid argument
ERROR: Not a Btrfs filesystem: Invalid argument

A hardware-configuration.nix is generated with a considerable numbers of stanzas that appear to correctly describe the instance, but it's not clear what effect if any the errors may have had on the output.

Subsequently trying to switch to a system based on this flake produces these errors:

$ sudo nixos-rebuild build --flake .#_hostname elided_
building the system configuration...
error:
       … while calling the 'head' builtin

         at /nix/store/62ca8xfz3n92p57sdds15r4s07kyls6i-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/62ca8xfz3n92p57sdds15r4s07kyls6i-source/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: A definition for option `fileSystems."/mnt/wslg/distro".device' is not of type `null or string (with check: non-empty)'. Definition values:
       - In `/nix/store/dvgvzizjxrq0a157pilqnkb10pr9wkyh-source/hardware-configuration.nix': ""
I understand that this is a niche use case, but I want to document my results here for whatever benefit it may have. This WSL2 instance is a vanilla nixos stable: ``` $ sudo nix-channel --list nixos https://nixos.org/channels/nixos-23.11 nixos-wsl https://github.com/nix-community/NixOS-WSL/archive/refs/heads/main.tar.gz ``` Following the description in https://github.com/auxolotl/templates "Getting Started" / "With Nixos", at the step: `$ nixos-generate-config --show-hardware-config > hardware-configuration.nix` the system responds with these errors: ``` ERROR: Not a Btrfs filesystem: Invalid argument ERROR: Not a Btrfs filesystem: Invalid argument ERROR: Not a Btrfs filesystem: Invalid argument ``` A `hardware-configuration.nix` is generated with a considerable numbers of stanzas that appear to correctly describe the instance, but it's not clear what effect if any the errors may have had on the output. Subsequently trying to switch to a system based on this flake produces these errors: ``` $ sudo nixos-rebuild build --flake .#_hostname elided_ building the system configuration... error: … while calling the 'head' builtin at /nix/store/62ca8xfz3n92p57sdds15r4s07kyls6i-source/lib/attrsets.nix:1575:11: 1574| || pred here (elemAt values 1) (head values) then 1575| head values | ^ 1576| else … while evaluating the attribute 'value' at /nix/store/62ca8xfz3n92p57sdds15r4s07kyls6i-source/lib/modules.nix:809:9: 808| in warnDeprecation opt // 809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 810| inherit (res.defsFinal') highestPrio; (stack trace truncated; use '--show-trace' to show the full trace) error: A definition for option `fileSystems."/mnt/wslg/distro".device' is not of type `null or string (with check: non-empty)'. Definition values: - In `/nix/store/dvgvzizjxrq0a157pilqnkb10pr9wkyh-source/hardware-configuration.nix': "" ```
liketechnik commented 2024-05-28 15:49:18 +00:00 (Migrated from github.com)

I believe the /mnt/wslg directory (and subdirectories) are WSL2 specific mounts, and it looks like nixos-generate-config doesn't handle those correctly for some reason.

Unfortunately, I'm not quite sure how this directory is mounted into WSL2 instances and how that might cause nixos-generate-config to fail (and I don't have a Windows to test/look into it).

(Side note: You might be interested in using NixOs-WSL for your nixos wsl configuration.)

I believe the `/mnt/wslg` directory (and subdirectories) are WSL2 specific mounts, and it looks like `nixos-generate-config` doesn't handle those correctly for some reason. Unfortunately, I'm not quite sure how this directory is mounted into WSL2 instances and how that might cause `nixos-generate-config` to fail (and I don't have a Windows to test/look into it). (Side note: You might be interested in using [NixOs-WSL](https://github.com/nix-community/NixOS-WSL) for your nixos wsl configuration.)
sls commented 2024-05-29 01:43:13 +00:00 (Migrated from github.com)

I believe the /mnt/wslg directory (and subdirectories) are WSL2 specific mounts, and it looks like nixos-generate-config doesn't handle those correctly for some reason.

Unfortunately, I'm not quite sure how this directory is mounted into WSL2 instances and how that might cause nixos-generate-config to fail (and I don't have a Windows to test/look into it).

No worries, I wanted to document this issue for others and future attention, but I understand that aux is probably going to be concerned with more foundational issues for some time. This just happened to be the NixOs install I had to experiment with. Thanks for taking a look at it.

(Side note: You might be interested in using NixOs-WSL for your nixos wsl configuration.)

Yes, that's how this install was done. You'll see that in the nix-channel list at the top of the issue. A good pointer for anyone hoping to do this same thing, I agree.

> I believe the `/mnt/wslg` directory (and subdirectories) are WSL2 specific mounts, and it looks like `nixos-generate-config` doesn't handle those correctly for some reason. > > Unfortunately, I'm not quite sure how this directory is mounted into WSL2 instances and how that might cause `nixos-generate-config` to fail (and I don't have a Windows to test/look into it). No worries, I wanted to document this issue for others and future attention, but I understand that aux is probably going to be concerned with more foundational issues for some time. This just happened to be the NixOs install I had to experiment with. Thanks for taking a look at it. > (Side note: You might be interested in using [NixOs-WSL](https://github.com/nix-community/NixOS-WSL) for your nixos wsl configuration.) Yes, that's how this install was done. You'll see that in the nix-channel list at the top of the issue. A good pointer for anyone hoping to do this same thing, I agree.
minion started working 2024-06-20 23:26:47 +00:00
minion canceled time tracking 2024-06-20 23:26:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: auxolotl/templates#32
No description provided.