Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
wrvsrx committed Mar 3, 2024
1 parent c02610e commit eb88b60
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
37 changes: 13 additions & 24 deletions pkgs/to-normal-packages/metacubexd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ let
nativeBuildInputs = [ bun ];
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
buildPhase = ''
mkdir cache
export XDG_CACHE_HOME=$PWD/cache
bun install --frozen-lockfile --verbose --production --ignore-scripts
'';
installPhase = "cp -r node_modules $out";
installPhase = "cp -r cache $out";
dontConfigure = true;
outputHash = "sha256-gspg6KUo5tDH57Guz1t+w9da7RVIQBcMBfYnQKHNID0=";
outputHash = "sha256-m0E6zoqUStGE5k1as0+nHEcRIhAA8PFKVo/prjF5uMY=";
outputHashAlgo = "sha256";
outputHashMode = "recursive";
dontFixup = true;
};
node_modules = stdenv.mkDerivation {
pname = pname + "_node_modules";
inherit version src;
out = stdenv.mkDerivation {
inherit pname version src;
nativeBuildInputs = [
bun
nodePackages.node-gyp
Expand All @@ -46,25 +47,13 @@ let
];
patches = [ ./husky.patch ];
buildPhase = ''
cp --no-preserve=mode -r ${node_modules_cache} node_modules
bun install --frozen-lockfile --verbose --production --force --prefer-offline
cp -r ${node_modules_cache} cache
export XDG_CACHE_HOME=$PWD/cache
chmod 755 $PWD/cache/.bun/install/cache
bun install --frozen-lockfile --verbose --production --force
bun run build
'';

installPhase = "cp -r node_modules $out";
dontConfigure = true;
installPhase = "cp -r dist $out";
};
in
stdenvNoCC.mkDerivation
{
inherit pname src version;
nativeBuildInputs = [ bun ];
configurePhase = "ln -s ${node_modules} node_modules";
buildPhase = ''
bun run build
'';
installPhase = ''
mkdir -p $out
ln -s $node_modules $out/node_modules
cp -r dist $out
'';
}
out
9 changes: 7 additions & 2 deletions pkgs/to-normal-packages/metacubexd/husky.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
diff --git a/package.json b/package.json
index c6fd398..efceb92 100644
index c6fd398..398409e 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
@@ -5,11 +5,11 @@
"license": "MIT",
"type": "module",
"scripts": {
- "build": "vite build",
+ "build": "node node_modules/.bin/vite build",
"dev": "vite",
"format": "prettier -w .",
"lint": "eslint --fix .",
Expand Down

0 comments on commit eb88b60

Please sign in to comment.