Skip to content

Commit

Permalink
Merge pull request NixOS#331029 from litchipi/mealie_fixup_backup
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisie authored Aug 10, 2024
2 parents 3b24504 + 0ec7dd5 commit 327996d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion nixos/modules/services/web-apps/mealie.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
16 changes: 12 additions & 4 deletions pkgs/by-name/me/mealie/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
}:

let
version = "1.9.0";
version = "1.11.0";
src = fetchFromGitHub {
owner = "mealie-recipes";
repo = "mealie";
rev = "v${version}";
hash = "sha256-gg7ClclBS9j9n4/3HLxbX8HXTz9Zw5+BYG2MEYRsRBU=";
hash = "sha256-tBbvmM66zCNpKqeekPY48j0t5PjLHeyQ8+kJ6755ivo=";
};

frontend = callPackage (import ./mealie-frontend.nix src version) { };
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand Down

0 comments on commit 327996d

Please sign in to comment.