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.
This commit is contained in:
Yaya 2023-07-05 11:34:37 +00:00 committed by Yureka
parent b10a609526
commit 71be5933cd

View File

@ -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"