63 lines
1.2 KiB
Nix
63 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
stdenvNoCC,
|
|
bun,
|
|
nodejs,
|
|
}: stdenvNoCC.mkDerivation (finalAttrs: {
|
|
pname = "tcl-guessr";
|
|
version = "0.0.1";
|
|
|
|
src = ../.;
|
|
|
|
nativeBuildInputs = [bun nodejs];
|
|
|
|
bunDeps = stdenvNoCC.mkDerivation {
|
|
pname = "${finalAttrs.pname}-bun-deps";
|
|
inherit (finalAttrs) version;
|
|
|
|
nativeBuildInputs = [bun];
|
|
|
|
src = lib.fileset.toSource {
|
|
root = finalAttrs.src;
|
|
fileset = lib.fileset.unions [
|
|
../package.json
|
|
../bun.lockb
|
|
../patches
|
|
];
|
|
};
|
|
|
|
dontConfigure = true;
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
bun install \
|
|
--frozen-lockfile \
|
|
--ignore-scripts \
|
|
--backend copyfile \
|
|
--force
|
|
|
|
cp -r node_modules/ $out
|
|
'';
|
|
|
|
outputHashMode = "recursive";
|
|
outputHash = "sha256-cYbyVt2Hc96WRAIsNkgnG0vUB47m1ixbhYhHmXetaII=";
|
|
};
|
|
|
|
configurePhase = ''
|
|
cp -r $bunDeps node_modules
|
|
chmod -R +w node_modules
|
|
patchShebangs node_modules/{*,.*}
|
|
'';
|
|
|
|
buildPhase = ''
|
|
bun run build
|
|
'';
|
|
|
|
installPhase = ''
|
|
cp -r .svelte-kit/cloudflare $out
|
|
'';
|
|
|
|
passthru = {
|
|
inherit (finalAttrs) bunDeps;
|
|
};
|
|
})
|