mealie: move frontend into package.nix
This commit is contained in:
@@ -1,68 +0,0 @@
|
||||
src: version:
|
||||
{
|
||||
lib,
|
||||
fetchYarnDeps,
|
||||
dart-sass,
|
||||
nodejs,
|
||||
fixup-yarn-lock,
|
||||
stdenv,
|
||||
yarn,
|
||||
writableTmpDirAsHomeHook,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "mealie-frontend";
|
||||
inherit version;
|
||||
src = "${src}/frontend";
|
||||
|
||||
yarnOfflineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/frontend/yarn.lock";
|
||||
hash = "sha256-F1dhdBHfT9N1Ejk7WLyz2BbKlTPfqqEDNi7ZTL3phWY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
fixup-yarn-lock
|
||||
nodejs
|
||||
(yarn.override { inherit nodejs; })
|
||||
writableTmpDirAsHomeHook
|
||||
dart-sass
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
sed -i 's+"@nuxt/fonts",+// NUXT FONTS DISABLED+g' nuxt.config.ts
|
||||
|
||||
yarn config --offline set yarn-offline-mirror "$yarnOfflineCache"
|
||||
fixup-yarn-lock yarn.lock
|
||||
yarn install --offline --frozen-lockfile --no-progress --non-interactive --ignore-scripts
|
||||
patchShebangs node_modules
|
||||
|
||||
substituteInPlace node_modules/sass-embedded/dist/lib/src/compiler-path.js \
|
||||
--replace-fail 'compilerCommand = (() => {' 'compilerCommand = (() => { return ["dart-sass"];'
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
export NUXT_TELEMETRY_DISABLED=1
|
||||
yarn --offline generate
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mv .output/public $out
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Frontend for Mealie";
|
||||
license = lib.licenses.agpl3Only;
|
||||
maintainers = with lib.maintainers; [
|
||||
litchipi
|
||||
esch
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
makeWrapper,
|
||||
nixosTests,
|
||||
@@ -9,6 +7,15 @@
|
||||
nltk-data,
|
||||
writeShellScript,
|
||||
nix-update-script,
|
||||
|
||||
# frontend
|
||||
fetchYarnDeps,
|
||||
dart-sass,
|
||||
nodejs,
|
||||
fixup-yarn-lock,
|
||||
stdenv,
|
||||
yarn,
|
||||
writableTmpDirAsHomeHook,
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -20,7 +27,63 @@ let
|
||||
hash = "sha256-DUwLCe221MQb6AEYNxNDWXoaEdf9q/dNklOXJncnnJ4=";
|
||||
};
|
||||
|
||||
frontend = callPackage (import ./mealie-frontend.nix src version) { };
|
||||
frontend = stdenv.mkDerivation {
|
||||
name = "mealie-frontend";
|
||||
inherit version;
|
||||
src = "${src}/frontend";
|
||||
|
||||
yarnOfflineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/frontend/yarn.lock";
|
||||
hash = "sha256-F1dhdBHfT9N1Ejk7WLyz2BbKlTPfqqEDNi7ZTL3phWY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
fixup-yarn-lock
|
||||
nodejs
|
||||
(yarn.override { inherit nodejs; })
|
||||
writableTmpDirAsHomeHook
|
||||
dart-sass
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
sed -i 's+"@nuxt/fonts",+// NUXT FONTS DISABLED+g' nuxt.config.ts
|
||||
|
||||
yarn config --offline set yarn-offline-mirror "$yarnOfflineCache"
|
||||
fixup-yarn-lock yarn.lock
|
||||
yarn install --offline --frozen-lockfile --no-progress --non-interactive --ignore-scripts
|
||||
patchShebangs node_modules
|
||||
|
||||
substituteInPlace node_modules/sass-embedded/dist/lib/src/compiler-path.js \
|
||||
--replace-fail 'compilerCommand = (() => {' 'compilerCommand = (() => { return ["dart-sass"];'
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
export NUXT_TELEMETRY_DISABLED=1
|
||||
yarn --offline generate
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mv .output/public $out
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Frontend for Mealie";
|
||||
license = lib.licenses.agpl3Only;
|
||||
maintainers = with lib.maintainers; [
|
||||
litchipi
|
||||
esch
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
python = python3;
|
||||
pythonpkgs = python.pkgs;
|
||||
|
||||
Reference in New Issue
Block a user