installing the boot loader...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
...
/nix/var/nix/profiles/system/sw/bin/bash: line 8: mount: command not found
Not sure why that error occurred, I have the binary in /usr/bin.
I thought it’d be cool to see the self contained reproducibility in action, but it seems to be more headache than I expected.
I’ll restart with a live ISO. Thanks for the help.
Unfortunately I don’t really have the option of booting a live ISO:
I booted in Debian on an Aarch64 machine, then installed Nix, and now need to install NixOS with nixos-install.
Because of that, a solution to the mount command not being found in nixos-install (despite which mount returning /nix/store/fdv1ary508pbwkzfh3rzgamqyzqsbmwk-util-linux-2.39.4-bin/bin/mount) would be greatly appreciated.
I’m running into this problem also. It’s suspicious to run into this and see that all of the references to it are in the last few weeks. I wonder if something has broken recently.
I did automatic iPXE install, got hit by it. Seems like initial 24.11 release was fine, it was broken along the way later in commits of release branch.
I do not have option to manually workaround.
UPDATE:
Trying to use disko-install and fail
indeed, if I do sudo chroot /mnt/disko-install-root/ sh (created by disko-install), mount does not exist. seems nixos-install uses /bin of mounted root directory.
Notice how it’s line 8 of the snippet, which aligns with the error messages reported here.
(it’s line 10 in nixos-unstable, line 8 in 24.11)
I think the fix is to have the target’s util-linux on PATH (which may differ from the util-linux installed on your host). The easy way to do this would be to just have the target’s system-path on PATH. So add /nix/var/nix/profiles/system/sw/bin to PATH, and I think that will fix it.
So add /nix/var/nix/profiles/system/sw/bin to PATH, and I think that will fix it.
I was confused about this at first, so maybe the following will help other people like me: The nixos-install.sh script @ElvishJerricco linked to will execute mountafter chrooting into the --root directory (e.g. /mnt), so binaries from the host system, like mount, will no longer be available. (In my case I was running nixos-install -p nixos-install-tools util-linux inside a nix-shell on Ubuntu and was surprised as to why mount couldn’t be found.) However, it seems environment variables from the shell on the host will propagate down to the chroot environment, so the solution is to set something like export PATH="$PATH:/nix/var/nix/profiles/system/sw/bin" in the host shell (in which nixos-install is started later). Here, /nix/var/… refers to a path inside the root folder that nixos-install will chroot into (e.g… /mnt).
Now, I have no idea why nixos-install.sh isn’t setting up PATH correctly in the first place but at least we’ve got a workaround!
Thanks everybody for the workaround suggestions, especially @codethief for the deep dive. I ran into this problem when running disko-install on an Ubuntu 22 machine. The workarounds posted here, while crucial, weren’t enough individually, so I documented the necessary steps to get my particular setup working. I hope these may help someone else as well.