I’m following the article:
Running NixOS from any Linux Distro in systemd-nspawn Containers (nixcademy.com)
I’m doing this using an arch linux distro running under latest wsl-2.
I hit an issue importing the tar file
machinectl pull-tar https://github.com/tfc/nspawn-nixos/releases/download/v1.0/nixos-system-x86_64-linux.tar.xz nixos --verify=no
I got the error:
Failed to transfer image: Interactive authentication required.
I worked around this by first downloading the tarball and then used “machinectl import-tar” which worked fine and I was able to set a password and login the the nixos container.
I was able to connect to the host network, run vim etc without issue.
When I tried to do a rebuild to add an nginx service I got:
nixos-rebuild switch
warning: creating lock file ‘/etc/nixos/flake.lock’
building the system configuration…
/nix/store/4ms7bgmm9485a9lz6v7d9jhjj89pzv0b-install-sbin-init.sh: line 2: ln: command not found
warning: error(s) occurred while switching to the new configuration
Though ln is available:
[root@nixos:~]# which ln
/run/current-system/sw/bin/ln
Does anyone know what the issue is or best way to debug?