| 17 Mar 2024 |
hexa | tried providing the phpfpm pool with iconv and mbstring extensions | 02:27:26 |
hexa | but no luck | 02:27:31 |
hexa | then found out that php82 ships with all kinds of extensions by default already | 02:35:57 |
hexa | still no dice | 02:36:05 |
@patka_123:matrix.org | Ill have a lool later today | 07:51:34 |
@patka_123:matrix.org | * | 08:00:12 |
@patka_123:matrix.org | hexa what did you do to get that exception? Just building it? | 09:57:36 |
hexa | Build the attached test | 10:15:25 |
hexa | * @patka: Build the attached test | 10:15:48 |
tgerbet | Something like this should do the trick
diff --git a/nixos/modules/services/web-apps/engelsystem.nix b/nixos/modules/services/web-apps/engelsystem.nix
index 669620debce5..7fb912415643 100644
--- a/nixos/modules/services/web-apps/engelsystem.nix
+++ b/nixos/modules/services/web-apps/engelsystem.nix
@@ -3,6 +3,8 @@
let
inherit (lib) mkDefault mkEnableOption mkIf mkOption types mkPackageOption;
cfg = config.services.engelsystem;
+ phpExt = pkgs.php.withExtensions
+ ({ enabled, all }: with all; [ filter mysqlnd mysqli pdo pdo_mysql mbstring ] ++ enabled);
in {
options = {
services.engelsystem = {
@@ -99,7 +101,7 @@ in {
'';
services.phpfpm.pools.engelsystem = {
- phpPackage = pkgs.php81;
+ phpPackage = phpExt;
user = "engelsystem";
settings = {
"listen.owner" = config.services.nginx.user;
diff --git a/pkgs/servers/web-apps/engelsystem/default.nix b/pkgs/servers/web-apps/engelsystem/default.nix
index 9b9cf0ff3bfe..8274f3e88418 100644
--- a/pkgs/servers/web-apps/engelsystem/default.nix
+++ b/pkgs/servers/web-apps/engelsystem/default.nix
@@ -2,15 +2,15 @@
let
phpExt = php.withExtensions
- ({ enabled, all }: with all; [ filter mysqlnd mysqli pdo pdo_mysql ]);
+ ({ enabled, all }: with all; [ filter mysqlnd mysqli pdo pdo_mysql mbstring ] ++ enabled);
in
stdenv.mkDerivation rec {
pname = "engelsystem";
- version = "3.4.1";
+ version = "3.5.0";
src = fetchzip {
url = "https://github.com/engelsystem/engelsystem/releases/download/v${version}/engelsystem-v${version}.zip";
- hash = "sha256-5KniP1nrLfmWHruXnUJmlvgL95U+EsDmCs4tg/YLWtw=";
+ hash = "sha256-RbzAHBZN02u14WaLtq5EOh4XwIdHKvzX7NhDBhn/CaU=";
};
buildInputs = [ phpExt ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1f6edde48394..acd7f66f5b61 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -25999,7 +25999,7 @@ with pkgs;
dspam = callPackage ../servers/mail/dspam { };
- engelsystem = callPackage ../servers/web-apps/engelsystem { php = php81; };
+ engelsystem = callPackage ../servers/web-apps/engelsystem { };
envoy = callPackage ../servers/http/envoy {
go = go_1_20;
| 11:01:03 |
@patka_123:matrix.org | That is exactly what I'm trying ^^ So at least I'm looking in the correct places. But I've never ran any tests and was running into unrelated things. I think I am getting there | 11:04:19 |
@patka_123:matrix.org | - engelsystem = callPackage ../servers/web-apps/engelsystem { php = php81; };
+ engelsystem = callPackage ../servers/web-apps/engelsystem { };
Just for my understanding. Providing the php version outside of the package itself is a historical thing? I find it a bit strange to not just pick the correct version in the package? | 11:05:32 |
@patka_123:matrix.org | I mean the callPackage with the provided php version. Instead of just getting php82 as an input to the package itself | 11:07:01 |
tgerbet | Not really, it is still the "usual" approach when it is expected that most of the packages will work fine with the default values (or will at some point in the future)
But yes both work
| 11:18:33 |
@patka_123:matrix.org | Makes sense, thanks! | 11:19:47 |
@patka_123:matrix.org | https://github.com/NixOS/nixpkgs/pull/296617 | 11:28:22 |
@patka_123:matrix.org | (in the end I ended up with just copying what tgerbet created because that was a nicer way of solving it than what I had) | 11:29:14 |
@patka_123:matrix.org | I wonder if I should package Laravel adjacent (ish) stuff like laravel-zero and phpinsights. I personally will not use them, but it's also very little effort to maintain them. Other people do use these tools | 12:35:06 |
Pol | It's fine to package them for sure. Even if I don't use these tools and even if I don't like the Laravel philosophy. | 12:38:11 |
@patka_123:matrix.org | I even actively discourage people to use it. But it is what it is. Normally packaging stuff that you don't use yourself is kinda discouraged. But I don't mind maintaining it, and dont see myself leaving | 12:43:20 |
@patka_123:matrix.org | But hexa is going to tell me differently :p | 12:43:43 |
hexa | hah 😄 | 12:48:09 |
hexa | thanks for digging into it | 12:48:14 |
hexa | I kinda disagree with using all-packages.nix for overrides most of the time, because stale overrides often get missed | 12:48:55 |
hexa | the file is too unwieldy for anyone to quickly want to check | 12:49:20 |
tgerbet | Yep | 12:51:40 |
hexa | what surprises me is that the derivation and module both construct their own php instance | 12:51:46 |
@patka_123:matrix.org | That was my initial thought seeing it for the first time. But also can get behind the override reason from the docs @tgerbet shared earlier
| 12:52:12 |
hexa | diff --git a/nixos/modules/services/web-apps/engelsystem.nix b/nixos/modules/services/web-apps/engelsystem.nix
index 669620debce5..343f2e1b7dc1 100644
--- a/nixos/modules/services/web-apps/engelsystem.nix
+++ b/nixos/modules/services/web-apps/engelsystem.nix
@@ -99,7 +99,11 @@ in {
'';
services.phpfpm.pools.engelsystem = {
- phpPackage = pkgs.php81;
+ phpPackage = pkgs.php82.buildEnv {
+ extraConfig = ''
+ session.gc_maxlifetime = 604800
+ '';
+ };
user = "engelsystem";
settings = {
"listen.owner" = config.services.nginx.user;
diff --git a/pkgs/servers/web-apps/engelsystem/default.nix b/pkgs/servers/web-apps/engelsystem/default.nix
index 53a33195f610..762b42391dd5 100644
--- a/pkgs/servers/web-apps/engelsystem/default.nix
+++ b/pkgs/servers/web-apps/engelsystem/default.nix
@@ -1,9 +1,10 @@
-{ lib, stdenv, fetchzip, php, writeText, nixosTests }:
+{ lib
+, stdenv
+, fetchzip
+, php82
+, nixosTests
+}:
-let
- phpExt = php.withExtensions
- ({ enabled, all }: with all; [ filter mysqlnd mysqli pdo pdo_mysql ]);
-in
stdenv.mkDerivation rec {
pname = "engelsystem";
version = "3.5.0";
@@ -13,7 +14,7 @@ stdenv.mkDerivation rec {
hash = "sha256-RbzAHBZN02u14WaLtq5EOh4XwIdHKvzX7NhDBhn/CaU=";
};
- buildInputs = [ phpExt ];
+ buildInputs = [ php82 ];
installPhase = ''
runHook preInstall
@@ -30,7 +31,7 @@ stdenv.mkDerivation rec {
echo $(command -v php)
# The patchShebangAuto function always used the php without extensions, so path the shebang manually
- sed -i -e "1 s|.*|#\!${phpExt}/bin/php|" "$out/share/engelsystem/bin/migrate"
+ sed -i -e "1 s|.*|#\!${lib.getExe php82}|" "$out/share/engelsystem/bin/migrate"
ln -s "$out/share/engelsystem/bin/migrate" "$out/bin/migrate"
runHook postInstall
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3a906641326c..b7e8a9d81ca9 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -25999,7 +25999,7 @@ with pkgs;
dspam = callPackage ../servers/mail/dspam { };
- engelsystem = callPackage ../servers/web-apps/engelsystem { php = php81; };
+ engelsystem = callPackage ../servers/web-apps/engelsystem { };
envoy = callPackage ../servers/http/envoy {
go = go_1_20;
| 12:52:19 |
hexa | this was that I tried myself | 12:52:24 |