nix run .#nixosConfigurations.svc-mtx01.config.microvm.deploy.rebuild
error: unable to execute '/nix/store/3h6bazmwjfxn26ypl4jsjswsv7pyypfx-microvm-rebuild/bin/microvm-rebuild': Exec format error
This has been an issue since I started using microvm.nix, and I might have talked about on Matrix, but don't remember.
Essentially, the problem is if I run the rebuild from Darwin I get an exec format error, this is because the script ends up with this shebang:
/nix/store/3hgg7pr65imdrifqqh3flg3arvkc2r22-bash-5.3p3/bin/bash
which is:
file /nix/store/3hgg7pr65imdrifqqh3flg3arvkc2r22-bash-5.3p3/bin/bash
/nix/store/3hgg7pr65imdrifqqh3flg3arvkc2r22-bash-5.3p3/bin/bash: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/7nbi22pcc92y2fqbkyp7h3srvvklmckb-glibc-2.40-224/lib/ld-linux-x86-64.so.2, BuildID[sha1]=1dd89254fa83163d4d12a8e15616116e31c7529e, for GNU/Linux 3.10.0, not stripped
as opposed to:
file $(which bash)
/nix/store/in4yc03diyvs2n2wgf3nva4hbvml8v1j-bash-interactive-5.3p9/bin/bash: Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE>
The microvm-rebuild script should use the host platform's bash.
This has been an issue since I started using microvm.nix, and I might have talked about on Matrix, but don't remember.
Essentially, the problem is if I run the rebuild from Darwin I get an exec format error, this is because the script ends up with this shebang:
/nix/store/3hgg7pr65imdrifqqh3flg3arvkc2r22-bash-5.3p3/bin/bashwhich is:
as opposed to:
The microvm-rebuild script should use the host platform's bash.