You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
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:
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': ""
The text was updated successfully, but these errors were encountered:
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).
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.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
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:
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:
The text was updated successfully, but these errors were encountered: