diff --git a/nixos/modules/services/web-apps/grocy.nix b/nixos/modules/services/web-apps/grocy.nix index b0d3c44cea81..d4b1a892867f 100644 --- a/nixos/modules/services/web-apps/grocy.nix +++ b/nixos/modules/services/web-apps/grocy.nix @@ -115,9 +115,9 @@ in { user = "grocy"; group = "nginx"; - # PHP 8.1 is the only version which is supported/tested by upstream: - # https://github.com/grocy/grocy/blob/v4.0.0/README.md#platform-support - phpPackage = pkgs.php81; + # PHP 8.1 and 8.2 are the only version which are supported/tested by upstream: + # https://github.com/grocy/grocy/blob/v4.0.2/README.md#platform-support + phpPackage = pkgs.php82; inherit (cfg.phpfpm) settings; diff --git a/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch b/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch index cc7c45e5e27f..8afef1211f80 100644 --- a/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch +++ b/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch @@ -1,4 +1,4 @@ -From 3ec6fce101083d4f23641fd015cbe4ade317ad59 Mon Sep 17 00:00:00 2001 +From 231ee836e357b83cc2fc0a3a977f74839308ec68 Mon Sep 17 00:00:00 2001 From: Ember Keske Date: Wed, 2 Aug 2023 06:36:02 +0200 Subject: [PATCH 1/2] Define configs with env vars @@ -11,7 +11,7 @@ Subject: [PATCH 1/2] Define configs with env vars 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app.php b/app.php -index 31905be6..30b3eb82 100644 +index bc5b1b39..26f7687e 100644 --- a/app.php +++ b/app.php @@ -12,7 +12,7 @@ use Slim\Views\Blade; @@ -23,16 +23,16 @@ index 31905be6..30b3eb82 100644 require_once __DIR__ . '/config-dist.php'; // For not in own config defined values we use the default ones require_once __DIR__ . '/helpers/ConfigurationValidator.php'; -@@ -63,7 +63,7 @@ $app = AppFactory::create(); - +@@ -64,7 +64,7 @@ $app = AppFactory::create(); $container = $app->getContainer(); - $container->set('view', function (Container $container) { + $container->set('view', function (Container $container) + { - return new Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache'); + return new Blade(__DIR__ . '/views', getenv('GROCY_CACHE_DIR')); }); - $container->set('UrlManager', function (Container $container) { -@@ -103,7 +103,7 @@ $errorMiddleware->setDefaultErrorHandler( + $container->set('UrlManager', function (Container $container) +@@ -106,7 +106,7 @@ $errorMiddleware->setDefaultErrorHandler( $app->add(new CorsMiddleware($app->getResponseFactory())); @@ -42,10 +42,10 @@ index 31905be6..30b3eb82 100644 ob_clean(); // No response output before here $app->run(); diff --git a/services/DatabaseService.php b/services/DatabaseService.php -index be5486b6..b6091ee7 100644 +index 4a05bda1..ce41ed17 100644 --- a/services/DatabaseService.php +++ b/services/DatabaseService.php -@@ -104,6 +104,6 @@ class DatabaseService +@@ -125,6 +125,6 @@ class DatabaseService return GROCY_DATAPATH . '/grocy_' . $dbSuffix . '.db'; } @@ -67,10 +67,10 @@ index 7d070350..a6dd4b08 100644 { mkdir($this->StoragePath); diff --git a/services/StockService.php b/services/StockService.php -index 16cb468c..23228803 100644 +index 7265e82b..13af591a 100644 --- a/services/StockService.php +++ b/services/StockService.php -@@ -1769,7 +1769,7 @@ class StockService extends BaseService +@@ -1761,7 +1761,7 @@ class StockService extends BaseService throw new \Exception('No barcode lookup plugin defined'); } diff --git a/pkgs/servers/grocy/0002-Remove-check-for-config-file-as-it-s-stored-in-etc-g.patch b/pkgs/servers/grocy/0002-Remove-check-for-config-file-as-it-s-stored-in-etc-g.patch index 5b6ae862dcb6..f239ca06dd09 100644 --- a/pkgs/servers/grocy/0002-Remove-check-for-config-file-as-it-s-stored-in-etc-g.patch +++ b/pkgs/servers/grocy/0002-Remove-check-for-config-file-as-it-s-stored-in-etc-g.patch @@ -1,4 +1,4 @@ -From 0e834aa0ef712ce97acf24c05c43a04387fda18c Mon Sep 17 00:00:00 2001 +From b532add2d1287489d4541e79c976bb77795696cd Mon Sep 17 00:00:00 2001 From: Ember Keske Date: Wed, 2 Aug 2023 06:36:46 +0200 Subject: [PATCH 2/2] Remove check for config-file as it's stored in /etc/grocy diff --git a/pkgs/servers/grocy/default.nix b/pkgs/servers/grocy/default.nix index 5777245d6780..2899141b61b4 100644 --- a/pkgs/servers/grocy/default.nix +++ b/pkgs/servers/grocy/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "grocy"; - version = "4.0.0"; + version = "4.0.2"; src = fetchurl { url = "https://github.com/grocy/grocy/releases/download/v${version}/grocy_${version}.zip"; - sha256 = "sha256-Sei+UYM5azzSWgnmgufxDl5ySbYJ52DBGPc0nTjnqqc="; + sha256 = "sha256-ZhXfZKmfg8lSzEAGIj7LMIfvaHG1FY5j+/OpOCTxm3c="; }; nativeBuildInputs = [ unzip ];