Thank you for the replies. That makes sense that the binary would need to be packaged for nix.
For context, I’m trying to chroot into another NixOS computer (aarch64) so that I can fix an issue with its NixOS configuration that’s causing it not to boot.
I’m following this wiki guide that oulines how to use nixos-enter: Change root - NixOS Wiki.
However, when I run nixos-enter I get the errors (which I believe to be the same as the one I originally sent):
chroot: failed to run command ‘/nix/var/nix/profiles/system/activate’: No such file or directory
chroot: failed to run command ‘/nix/var/nix/profiles/system/sw/bin/bash’: No such file or directory
Digging more into it, I noticed that the activate script was not missing. I also found that chroot won’t properly report which file is missing (thanks to this Stack Overlow linux - chroot "no such file or directory" prints wrong missing file - Stack Overflow).
So, I did some more debugging and tried to run some binaries in the nix store of the aarch64 computer that I mounted. I tried running bash in the aarch64 computer’s nix store and got exactly the original error I sent.
Any thoughts on a way around this? Or is it not possible to chroot into NixOS from a different architecture?