foxpro 🐍F
Denoβ€’3y agoβ€’
4 replies
foxpro 🐍

`deno compile` in Nix results in `deno repl` starting instead of actual program

I wrote following Nix impure derivation for my Deno app:
packages.api = pkgs.stdenv.mkDerivation rec {
  name = "api";
  src = ./api;
  __noChroot = true;
  __impure = true;
  nativeBuildInputs = with pkgs; [
    deno
    unzip
  ];
  buildPhase = ''
    export DENO_DIR=.deno
    mkdir $DENO_DIR
    runHook preBuild
    export HOME=$(mktemp -d)
    deno compile -A ./main.ts --output ./dist/${name} --target=x86_64-unknown-linux-gnu --unstable
    runHook postBuild
  '';
  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    cp ./dist/${name} $out/bin/${name}
    ls $out/bin
    runHook postInstall
  '';
};

Here it is build log: https://pastebin.com/fjs7JiK8
But running program via nix run or just manually /nix/store/v8j5iwa9ji48rhd63wp9nj22rydrl83x-api/bin/api results in opening Deno repl (pic) and not the actual program
What am I missing here?
image.png
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Was this page helpful?