refactor: ♻️ [BROKEN] Refactor Nix build to use fetchBunDeps PR

This commit is contained in:
Jesse Wierzbinski 2025-06-22 17:46:29 +02:00
parent 03940cd8fd
commit 1a666e8371
No known key found for this signature in database
4 changed files with 151 additions and 303 deletions

View file

@ -1,11 +1,14 @@
{
lib,
stdenv,
pnpm,
bun,
nodejs,
vips,
makeWrapper,
fetchBunDeps,
bunConfigHook,
bunInstallHook,
bunBuildHook,
...
}: let
packageJson = builtins.fromJSON (builtins.readFile ../package.json);
@ -16,34 +19,22 @@ in
src = ../.;
# Fixes the build script mv usage
pnpmInstallFlags = ["--shamefully-hoist"];
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src pnpmInstallFlags;
hash = "sha256-nC1bYW+It2N0Mp8+Yh1uk3MOj8DABOCNP5E3LbMuCEQ=";
bunOfflineCache = fetchBunDeps {
bunLock = finalAttrs.src + "/bun.lock";
hash = "sha256-8R+LzgqAiqRGCMDBw2R7QO6hbdNrtIwzSjR3A8xhfVw=";
};
bunBuildScript = "packages/api/build.ts";
nativeBuildInputs = [
pnpm
pnpm.configHook
bun
nodejs
makeWrapper
bunConfigHook
bunInstallHook
bunBuildHook
];
buildInputs = [
vips
];
buildPhase = ''
runHook preBuild
bun run packages/api/build.ts
runHook postBuild
'';
entrypointPath = "packages/api/index.js";
installPhase = let