gr-base/shelf/hjq/package.nix

41 lines
798 B
Nix
Raw Normal View History

2025-08-02 02:17:27 +07:00
{ pkgs, target }:
2025-08-02 00:07:09 +07:00
pkgs.stdenv.mkDerivation rec {
2025-08-02 02:17:27 +07:00
pname = "hjq";
2025-08-02 00:07:09 +07:00
version = "0.1.0";
src = ./.;
__noChroot = true;
dontStrip = true;
denort = pkgs.fetchurl {
url = "https://dl.deno.land/release/v${pkgs.deno.version}/denort-${target}.zip";
hash = "sha256-J2LfvHPbJvcOpbQOd6EmGxHDciez7tG10etK4bqQhLI=";
};
nativeBuildInputs = with pkgs; [ deno unzip ];
configurePhase = ''
export DENO_DIR=./.deno_cache;
mkdir -p $TMPDIR/denort
pushd $TMPDIR/denort
unzip ${denort}
chmod +x denort
popd
'';
buildPhase = ''
runHook preBuild
export DENORT_BIN="$TMPDIR/denort/denort"
2025-08-02 02:17:27 +07:00
deno compile --target=${target} --output app main.ts
2025-08-02 00:07:09 +07:00
runHook postBuild
'';
installPhase = ''
mkdir -p $out/bin
2025-08-02 02:17:27 +07:00
cp app $out/bin/${pname}
2025-08-02 00:07:09 +07:00
'';
}