add hjq scroll

This commit is contained in:
EatThePooh 2025-08-02 02:17:27 +07:00
parent 701e5d138a
commit d92bc3b437
4 changed files with 54 additions and 20 deletions

40
shelf/hjq/package.nix Normal file
View file

@ -0,0 +1,40 @@
{ pkgs, target }:
pkgs.stdenv.mkDerivation rec {
pname = "hjq";
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"
deno compile --target=${target} --output app main.ts
runHook postBuild
'';
installPhase = ''
mkdir -p $out/bin
cp app $out/bin/${pname}
'';
}