From 71be5933cdd12aad759b2f5a08d12e5cb0b89117 Mon Sep 17 00:00:00 2001 From: Yaya Date: Wed, 5 Jul 2023 11:34:37 +0000 Subject: [PATCH] nixos/snipe-it: Use the pinned PHP package As 3bb3859 bumped the default PHP version to 8.2, the snipe-it package has been pinned to PHP 8.1. This commit changes the php package used in the module to the one pinned by snipe-it. --- nixos/modules/services/web-apps/snipe-it.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/web-apps/snipe-it.nix b/nixos/modules/services/web-apps/snipe-it.nix index 93b0aafab64b..e861a4185194 100644 --- a/nixos/modules/services/web-apps/snipe-it.nix +++ b/nixos/modules/services/web-apps/snipe-it.nix @@ -15,6 +15,8 @@ let tlsEnabled = cfg.nginx.addSSL || cfg.nginx.forceSSL || cfg.nginx.onlySSL || cfg.nginx.enableACME; + inherit (snipe-it.passthru) phpPackage; + # shell script for local administration artisan = pkgs.writeScriptBin "snipe-it" '' #! ${pkgs.runtimeShell} @@ -23,7 +25,7 @@ let if [[ "$USER" != ${user} ]]; then sudo='exec /run/wrappers/bin/sudo -u ${user}' fi - $sudo ${pkgs.php}/bin/php artisan $* + $sudo ${phpPackage}/bin/php artisan $* ''; in { options.services.snipe-it = { @@ -340,8 +342,7 @@ in { }; services.phpfpm.pools.snipe-it = { - inherit user group; - phpPackage = pkgs.php81; + inherit user group phpPackage; phpOptions = '' post_max_size = ${cfg.maxUploadSize} upload_max_filesize = ${cfg.maxUploadSize} @@ -450,7 +451,7 @@ in { rm "${cfg.dataDir}"/bootstrap/cache/*.php || true # migrate db - ${pkgs.php}/bin/php artisan migrate --force + ${phpPackage}/bin/php artisan migrate --force # A placeholder file for invalid barcodes invalid_barcode_location="${cfg.dataDir}/public/uploads/barcodes/invalid_barcode.gif"