2024-04-21 15:54:59 +00:00
|
|
|
{ stdenv, fetchYarnDeps, fixup-yarn-lock, callPackage, nodejs }:
|
2022-10-06 18:32:54 +00:00
|
|
|
let
|
|
|
|
common = callPackage ./common.nix { };
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "tandoor-recipes-frontend";
|
|
|
|
inherit (common) version;
|
|
|
|
|
|
|
|
src = "${common.src}/vue";
|
|
|
|
|
|
|
|
yarnOfflineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${common.src}/vue/yarn.lock";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = common.yarnHash;
|
2022-10-06 18:32:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
fixup-yarn-lock
|
2023-05-24 13:37:59 +00:00
|
|
|
nodejs
|
|
|
|
nodejs.pkgs.yarn
|
2022-10-06 18:32:54 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
yarn config --offline set yarn-offline-mirror "$yarnOfflineCache"
|
2024-01-02 11:29:13 +00:00
|
|
|
fixup-yarn-lock yarn.lock
|
2022-10-06 18:32:54 +00:00
|
|
|
command -v yarn
|
|
|
|
yarn install --frozen-lockfile --offline --no-progress --non-interactive
|
|
|
|
patchShebangs node_modules/
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
yarn --offline run build
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
cp -R ../cookbook/static/vue/ $out
|
|
|
|
cp webpack-stats.json $out
|
|
|
|
echo "${common.version}" > "$out/version"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = common.meta // {
|
|
|
|
description = "Tandoor Recipes frontend";
|
|
|
|
};
|
|
|
|
}
|