mkDerivation modifying binary

TLDR:

  • $out/bin/main works when in nix develop and in nix shell
  • it works when using builtins.derivation
  • doesn’t with stdenv.mkDerivation

Deno and bash are the only build inputs.
dontPatchShebangs = 1; (although it shouldn’t matter).

installPhase is just deno --compile and putting the output in the bin:

mkdir -p "$out/bin"
export HOME="$out/bin/home" <- mostly for debugging

"${deno}/bin/deno" compile --allow-all --output "$out/bin/main" "$src/build_helper/main.bundle.js"

# only for debugging
"$out/bin/nvs" --help > "$out/bin/help.txt"

Whats the best way for me to debug this?

do you have this stuff in git , so we can have the ‘producer’

Not sure exactly what you mean, but the full default.nix can be found here