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
'';
};
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
'';
};