!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

64 Members
A room for PHP developers running on Nix22 Servers

Load older messages


SenderMessageTime
17 Aug 2024
@piotrkwiecinski:matrix.orgpiotrkwiecinskiOverlay relies on https://github.com/piotrkwiecinski/php-src-nix/blob/main/src/makePhpPackage.nix#L1309:45:15
@piotrkwiecinski:matrix.orgpiotrkwiecinskithis means version specific patches from nixpkgs aren't applied09:45:36
@piotrkwiecinski:matrix.orgpiotrkwiecinskiwe would have to move https://github.com/piotrkwiecinski/nixpkgs/blob/fa088a9477b35d8e36c8204c35fc574eaffe0190/pkgs/development/interpreters/php/8.1.nix#L7-L31 to generic.nix09:46:12
@piotrkwiecinski:matrix.orgpiotrkwiecinskiit would make backporting easier09:46:28
@drupol:matrix.orgPolyeah there are some improvements to be made.18:09:57
@drupol:matrix.orgPolJust added you as maintainer18:10:03
@piotrkwiecinski:matrix.orgpiotrkwiecinskiGot it. Thank you. I have 59 builds passing. Still 49 to go. It'll probably take at least a couple days.18:18:25
@drupol:matrix.orgPolthere's no hurry18:44:07
18 Aug 2024
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz 19:03:37
20 Aug 2024
@fsagbuya:matrix.orgfsagbuya joined the room.08:58:03
@fsagbuya:matrix.orgfsagbuya

Hi. Is there a good way to extend a certain package with a php extension using buildComposerProject? I managed to do that by making the following changes:

 git diff pkgs/by-name/fl/flarum/package.nix
diff --git a/pkgs/by-name/fl/flarum/package.nix b/pkgs/by-name/fl/flarum/package.nix
index ee38394cd1a5..f37d7349bc06 100644
--- a/pkgs/by-name/fl/flarum/package.nix
+++ b/pkgs/by-name/fl/flarum/package.nix
@@ -14,9 +14,18 @@ php.buildComposerProject (finalAttrs: {
     hash = "sha256-kigUZpiHTM24XSz33VQYdeulG1YI5s/M02V7xue72VM=";
   };
 
+  postPatch = ''
+    substituteInPlace composer.json \
+      --replace '"flarum/core": "^1.8"' \
+            '"flarum/core": "^1.8",
+            "fof/polls": "*",
+            "fof/subscribed": "*",
+            "fof/upload": "*"'
+  '';
+
   composerLock = ./composer.lock;
   composerStrictValidation = false;
-  vendorHash = "sha256-gQkjuatItw93JhI7FVfg5hYxkC1gsRQ3c2C2+MhI/Jg=";
+  vendorHash = "sha256-GUyBQ9uv6i99ICz4AaV1okmXdVF6TebBX6OQtUaXwJw=";
 
   meta = with lib; {
     changelog = "https://github.com/flarum/framework/blob/main/CHANGELOG.md";

However, I'm not sure if this is the proper way. Is there an extension management system for php packages similar to what's available for vscode?

09:05:28
@fsagbuya:matrix.orgfsagbuya *

Hi. Is there a good way to extend a certain package with a php extension using buildComposerProject? I managed to do that by making the following changes:

git diff pkgs/by-name/fl/flarum/package.nix
diff --git a/pkgs/by-name/fl/flarum/package.nix b/pkgs/by-name/fl/flarum/package.nix
index ee38394cd1a5..f37d7349bc06 100644
--- a/pkgs/by-name/fl/flarum/package.nix
+++ b/pkgs/by-name/fl/flarum/package.nix
@@ -14,9 +14,18 @@ php.buildComposerProject (finalAttrs: {
     hash = "sha256-kigUZpiHTM24XSz33VQYdeulG1YI5s/M02V7xue72VM=";
   };
 
+  postPatch = ''
+    substituteInPlace composer.json \
+      --replace '"flarum/core": "^1.8"' \
+            '"flarum/core": "^1.8",
+            "fof/polls": "*",
+            "fof/subscribed": "*",
+            "fof/upload": "*"'
+  '';
+
   composerLock = ./composer.lock;
   composerStrictValidation = false;
-  vendorHash = "sha256-gQkjuatItw93JhI7FVfg5hYxkC1gsRQ3c2C2+MhI/Jg=";
+  vendorHash = "sha256-GUyBQ9uv6i99ICz4AaV1okmXdVF6TebBX6OQtUaXwJw=";
 
   meta = with lib; {
     changelog = "https://github.com/flarum/framework/blob/main/CHANGELOG.md";

However, I'm not sure if this is the proper way. Is there an extension management system for php packages similar to what's available for vscode?

09:05:57
@fsagbuya:matrix.orgfsagbuya *

Hi. Is there a good way to extend a certain package with a php extension using buildComposerProject? I managed to do that by making the following changes:

diff --git a/pkgs/by-name/fl/flarum/package.nix b/pkgs/by-name/fl/flarum/package.nix
index ee38394cd1a5..f37d7349bc06 100644
--- a/pkgs/by-name/fl/flarum/package.nix
+++ b/pkgs/by-name/fl/flarum/package.nix
@@ -14,9 +14,18 @@ php.buildComposerProject (finalAttrs: {
     hash = "sha256-kigUZpiHTM24XSz33VQYdeulG1YI5s/M02V7xue72VM=";
   };
 
+  postPatch = ''
+    substituteInPlace composer.json \
+      --replace '"flarum/core": "^1.8"' \
+            '"flarum/core": "^1.8",
+            "fof/polls": "*",
+            "fof/subscribed": "*",
+            "fof/upload": "*"'
+  '';
+
   composerLock = ./composer.lock;
   composerStrictValidation = false;
-  vendorHash = "sha256-gQkjuatItw93JhI7FVfg5hYxkC1gsRQ3c2C2+MhI/Jg=";
+  vendorHash = "sha256-GUyBQ9uv6i99ICz4AaV1okmXdVF6TebBX6OQtUaXwJw=";
 
   meta = with lib; {
     changelog = "https://github.com/flarum/framework/blob/main/CHANGELOG.md";

However, I'm not sure if this is the proper way. Is there an extension management system for php packages similar to what's available for vscode?

09:06:13
@drupol:matrix.orgPol I think this is the way to go. Either that or a .patch. 09:14:53
@drupol:matrix.orgPolIsn't this supposed to be fixed upstream?09:15:20
@fsagbuya:matrix.orgfsagbuya The upstream package is only the base installation; however, these are good extensions to add for the Flarum package, and that is how we used it. I only added this in my local nixpkgs because some users may not want to enable it. I can push these packages if it's alright. Although, I'm thinking there might be a way to make this optional. 09:19:34
@fsagbuya:matrix.orgfsagbuya
In reply to @drupol:matrix.org
I think this is the way to go. Either that or a .patch.
an optional .patch is a good idea too
09:22:51
@drupol:matrix.orgPolcomposer doesn't have, like python, a way to compose groups of dependencies.09:41:45
@drupol:matrix.orgPolSo I guess using a patch is the way to go.09:41:53
@drupol:matrix.orgPol I think the buildComposerProject2 will help this. 09:42:06
@drupol:matrix.orgPolhttps://github.com/NixOS/nixpkgs/pull/30805909:42:39
@fsagbuya:matrix.orgfsagbuya
In reply to @drupol:matrix.org
So I guess using a patch is the way to go.
Will try to add an optional patch upstream for the meantime until the buildComposerProject2 is merged. Thanks!
09:46:18
@drupol:matrix.orgPolespecially this: https://github.com/NixOS/nixpkgs/pull/308059/files#diff-bead697169711cba8bf1ffc5a302d4dbe3f7d72513c9043cd431aba2c885885bR4109:47:25
@piotrkwiecinski:matrix.orgpiotrkwiecinskiI reckon we should merge https://github.com/NixOS/nixpkgs/pull/30805914:13:32
@piotrkwiecinski:matrix.orgpiotrkwiecinskiand start using it in the wild14:13:42
@piotrkwiecinski:matrix.orgpiotrkwiecinskiwe can always improve it in the future14:14:20
@drupol:matrix.orgPolDone :)16:40:21
@drupol:matrix.orgPolChampagne!16:43:03
@drupol:matrix.orgPol You're motivated piotrkwiecinski ! 17:53:13
@drupol:matrix.orgPolYou were waiting that new builder since quite a while17:53:30

Show newer messages


Back to Room ListRoom Version: 6