diff --git a/pkgs/by-name/me/mealie/mealie-frontend.nix b/pkgs/by-name/me/mealie/mealie-frontend.nix deleted file mode 100644 index b3359fb64271..000000000000 --- a/pkgs/by-name/me/mealie/mealie-frontend.nix +++ /dev/null @@ -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 - ]; - }; -} diff --git a/pkgs/by-name/me/mealie/package.nix b/pkgs/by-name/me/mealie/package.nix index 765822f5dfa9..48a7a30fa2d9 100644 --- a/pkgs/by-name/me/mealie/package.nix +++ b/pkgs/by-name/me/mealie/package.nix @@ -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;