part-db: 1.14.5 -> 2.4.0

This commit is contained in:
oddlama
2026-01-18 11:12:51 +01:00
parent 41a88fa547
commit 8a242fb675
3 changed files with 21 additions and 37 deletions
+4 -1
View File
@@ -153,6 +153,9 @@ in
// cfg.poolConfig;
};
# Required for symphony
part-db.settings.APP_SHARE_DIR = "/var/lib/part-db/share";
postgresql = mkIf cfg.enablePostgresql {
enable = true;
ensureUsers = [
@@ -173,7 +176,7 @@ in
root = "${pkg}/public";
locations = {
"/" = {
tryFiles = "$uri $uri/ /index.php";
tryFiles = "$uri $uri/ /index.php?$query_string";
index = "index.php";
extraConfig = ''
sendfile off;
@@ -1,24 +0,0 @@
diff --git a/composer.json b/composer.json
index 0659f2ee..5a2dee70 100644
--- a/composer.json
+++ b/composer.json
@@ -1,4 +1,6 @@
{
+ "name": "part-db/part-db-server",
+ "description": "Part-DB is an Open source inventory management system for your electronic components",
"type": "project",
"license": "AGPL-3.0-or-later",
"require": {
diff --git a/composer.lock b/composer.lock
index 614a35f7..e0c949eb 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "465fa2ab7f9f8dad2b8cfbeaa640c136",
+ "content-hash": "cec123f8cbf51820ba08c5c69ec2ded4",
"packages": [
{
"name": "amphp/amp",
+17 -12
View File
@@ -7,29 +7,24 @@
nodejs,
yarnConfigHook,
yarnBuildHook,
yarnInstallHook,
envLocalPath ? "/var/lib/part-db/env.local",
cachePath ? "/var/cache/part-db/",
logPath ? "/var/log/part-db/",
}:
let
pname = "part-db";
version = "1.14.5";
version = "2.4.0";
srcWithVendor = php.buildComposerProject {
srcWithVendor = php.buildComposerProject2 {
inherit pname version;
src = fetchFromGitHub {
owner = "Part-DB";
repo = "Part-DB-server";
tag = "v${version}";
hash = "sha256-KtNWog4aSnmgJsFckDuBrlnd9cj1f8kmSFi+nv2cZOg=";
hash = "sha256-z/bvFFzKVMN6lr9RnrBc/hTrZ9a/mjgpkDYslUFHM50=";
};
patches = [
./fix-composer-validate.diff
];
php = php.buildEnv {
extensions = (
{ enabled, all }:
@@ -40,15 +35,25 @@ let
);
};
vendorHash = "sha256-PJtm/3Vdm2zomUklVMKlDAe/vziJN4e+JNNf/u8N3B4=";
vendorHash = "sha256-gt5HBi+vV5WhaEXNFFIO8xcbX1Z60SICvxXWGNzsn5o=";
# Upstream composer.json file is missing the description field
composerStrictValidation = false;
composerNoPlugins = false;
postInstall = ''
chmod -R u+w $out/share
cd "$out"/share/php/part-db
echo "Running composer dump-autoload to generate autoload_runtime.php..."
composer dump-autoload --no-interaction
export APP_ENV=prod
export APP_SECRET=dummy
export DATABASE_URL=sqlite:///%kernel.project_dir%/data/app.db
php -d memory_limit=256M bin/console cache:warmup
cd /build
mv "$out"/share/php/part-db/* $out/
mv "$out"/share/php/part-db/.* $out/
cd $out/
php -d memory_limit=256M bin/console cache:warmup
rm -rf "$out/share"
'';
};
in
@@ -59,7 +64,7 @@ stdenv.mkDerivation (finalAttrs: {
yarnOfflineCache = fetchYarnDeps {
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-Mjss2UUHVUdJ4UAI3GkG6HB6g7LbJTqvgrIXFhZmw1Q=";
hash = "sha256-F9kZ8nAIghkg+xUkglvRZXOSadv2lbKTP0gNfLD4LYE=";
};
nativeBuildInputs = [