From 0ec7dd501176e2189e8d7a1b87e6b643f8872419 Mon Sep 17 00:00:00 2001 From: Litchi Pi Date: Sat, 10 Aug 2024 16:23:27 +0200 Subject: [PATCH] fix: replace relative paths in sources with nix store paths Signed-off-by: Litchi Pi --- nixos/modules/services/web-apps/mealie.nix | 1 - pkgs/by-name/me/mealie/package.nix | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/web-apps/mealie.nix b/nixos/modules/services/web-apps/mealie.nix index 2484b2489c0d..ab94103954e1 100644 --- a/nixos/modules/services/web-apps/mealie.nix +++ b/nixos/modules/services/web-apps/mealie.nix @@ -57,7 +57,6 @@ in environment = { PRODUCTION = "true"; - ALEMBIC_CONFIG_FILE="${pkg}/config/alembic.ini"; API_PORT = toString cfg.port; BASE_URL = "http://localhost:${toString cfg.port}"; DATA_DIR = "/var/lib/mealie"; diff --git a/pkgs/by-name/me/mealie/package.nix b/pkgs/by-name/me/mealie/package.nix index 9bffdee3e0f1..16f9379dfb74 100644 --- a/pkgs/by-name/me/mealie/package.nix +++ b/pkgs/by-name/me/mealie/package.nix @@ -93,8 +93,16 @@ pythonpkgs.buildPythonPackage rec { ]; postPatch = '' + rm -rf dev # Do not need dev scripts & code + substituteInPlace mealie/__init__.py \ --replace-fail '__version__ = ' '__version__ = "v${version}" #' + + substituteInPlace mealie/services/backups_v2/alchemy_exporter.py \ + --replace-fail 'PROJECT_DIR = ' "PROJECT_DIR = Path('$out') #" + + substituteInPlace mealie/db/init_db.py \ + --replace-fail 'PROJECT_DIR = ' "PROJECT_DIR = Path('$out') #" ''; postInstall = let @@ -106,10 +114,10 @@ pythonpkgs.buildPythonPackage rec { ${python.interpreter} $OUT/${python.sitePackages}/mealie/db/init_db.py ''; in '' - mkdir -p $out/config $out/bin $out/libexec + mkdir -p $out/bin $out/libexec rm -f $out/bin/* - substitute ${src}/alembic.ini $out/config/alembic.ini \ + substitute ${src}/alembic.ini $out/alembic.ini \ --replace-fail 'script_location = alembic' 'script_location = ${src}/alembic' makeWrapper ${start_script} $out/bin/mealie \