data endpoint for entity 90008 (aka. a website)

build: fix nix packaging to use deno tm

ptr.pet e8096a7b de7d14d1

verified
Changed files
+17 -17
nix
+9 -8
nix/default.nix
···
{
lib,
stdenv,
-
bun,
+
deno,
+
nodejs,
makeBinaryWrapper,
gazesys-modules,
PUBLIC_BASE_URL ? "http://localhost:5173",
···
fileset = lib.fileset.unions [
../src
../static
-
../bun.lock
+
../deno.lock
../package.json
../postcss.config.js
../svelte.config.js
···
};
nativeBuildInputs = [makeBinaryWrapper];
-
buildInputs = [bun];
+
buildInputs = [deno];
inherit PUBLIC_BASE_URL;
···
cp -R --no-preserve=ownership ${gazesys-modules} node_modules
find node_modules -type d -exec chmod 755 {} \;
substituteInPlace node_modules/.bin/vite \
-
--replace-fail "/usr/bin/env node" "${bun}/bin/bun --bun"
+
--replace-fail "/usr/bin/env node" "${nodejs}/bin/node"
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
-
bun --prefer-offline run build
+
HOME=$TMPDIR deno run --cached-only build
runHook postBuild
'';
installPhase = ''
···
cp -R ./build/* $out
cp -R ./node_modules $out
-
makeBinaryWrapper ${bun}/bin/bun $out/bin/website \
-
--prefix PATH : ${lib.makeBinPath [ bun ]} \
-
--add-flags "run --bun --no-install --cwd $out start"
+
makeBinaryWrapper ${deno}/bin/deno $out/bin/website \
+
--prefix PATH : ${lib.makeBinPath [ deno ]} \
+
--add-flags "run --allow-all --node-modules-dir=manual --cached-only $out/index.js"
runHook postInstall
'';
+8 -9
nix/modules.nix
···
{
lib,
stdenv,
-
bun,
+
deno,
}:
stdenv.mkDerivation {
name = "gazesys-modules";
···
src = lib.fileset.toSource {
root = ../.;
fileset = lib.fileset.unions [
-
../bun.lock
+
../deno.lock
../package.json
];
};
-
outputHash = "sha256-XqJ32vIa7ex+SpOaK8Qh4YRSffN6ekvwb9bddREGAOA=";
+
outputHash = "sha256-FhJT1CR5FyGlWMYjGDQDSebXtPWdRvDn5DR/rtk/T+4=";
outputHashAlgo = "sha256";
outputHashMode = "recursive";
-
nativeBuildInputs = [bun];
+
nativeBuildInputs = [deno];
dontConfigure = true;
dontCheck = true;
dontFixup = true;
dontPatchShebangs = true;
-
buildPhase = "bun install --no-cache --no-progress --frozen-lockfile";
+
buildPhase = ''
+
HOME=$TMPDIR deno install --allow-scripts=npm:protobufjs@7.5.4 --frozen --seed 8008135
+
'';
installPhase = ''
-
mkdir -p $out
-
-
cp -R ./node_modules/* $out
-
cp -R ./node_modules/.bin $out
+
cp -R node_modules $out
ls -la $out
'';
}