!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

64 Members
A room for PHP developers running on Nix22 Servers

Load older messages


SenderMessageTime
21 Jun 2024
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz

Okay, so I haven't solved it. I'm using the file

{ lib
, fetchFromGitHub
, stdenvNoCC
, php83
, nixosTests
, dataDir ? "/var/lib/firefly-iii"
}:

let
  pname = "firefly-iii";
  version = "6.1.18";
  phpPackage = php83;

  src = fetchFromGitHub {
    owner = "firefly-iii";
    repo = "firefly-iii";
    rev = "v${version}";
    hash = "sha256-mA7gvKhHouUUz1Aix7253O/+VcufoEFwdcJeZxnazEo=";
  };
in

stdenvNoCC.mkDerivation (finalAttrs: {
  inherit pname src version;

  buildInputs = [ phpPackage ];

  nativeBuildInputs = [
    phpPackage.packages.composer
    phpPackage.composerHooks.composerInstallHook
  ];

  composerRepository = phpPackage.mkComposerRepository {
    inherit (finalAttrs) src pname version;
    composerNoDev = true;
    composerNoPlugins = true;
    composerNoScripts = true;
    composerStrictValidation = true;
    # composerLock = null;
    vendorHash = "sha256-EpMypgj6lZDz6T94bGoCUH9IVwh7VB4Ds08AcCsreRw=";
  };

  passthru = {
    inherit phpPackage;
    tests = nixosTests.firefly-iii;
  };
    # cp -a ${assets} $out/public

  postInstall = ''
    mv $out/share/php/${pname}/* $out/
    rm -R $out/share $out/storage $out/bootstrap/cache $out/public
    ln -s ${dataDir}/storage $out/storage
    ln -s ${dataDir}/cache $out/bootstrap/cache
  '';

  meta = {
    changelog = "https://github.com/firefly-iii/firefly-iii/releases/tag/v${version}";
    description = "Firefly III: a personal finances manager";
    homepage = "https://github.com/firefly-iii/firefly-iii";
    license = lib.licenses.agpl3Only;
    maintainers = [ lib.maintainers.savyajha ];
  };
})
18:17:43
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzThis ought to build the package, even though it may not work.18:17:58
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz But I get Command "build-local-repo-lock" is not defined and the build errors 18:18:15
@drupol:matrix.orgPolLine 28, you need composerWithPlugin19:24:15
@drupol:matrix.orgPolCan't really help right now sorry :(19:24:27
22 Jun 2024
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzNo worries. But do let me know exactly how to get this working because I can'03:40:55
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz * No worries. But do let me know exactly how to get this working because I can't see any examples for the same03:41:02
@drupol:matrix.orgPol you need this version of Composer: php.packages.composer-local-repo-plugin 08:52:06
@drupol:matrix.orgPol * you need this version of Composer: php.packages.composer-local-repo-plugin 08:52:11
@drupol:matrix.orgPol (you can find this in pkgs/build-support/php/builders/v1/build-composer-repository.nix 08:52:25
@drupol:matrix.orgPol * (you can find this in pkgs/build-support/php/builders/v1/build-composer-repository.nix) 08:52:28
@drupol:matrix.orgPolThat version of Composer has the only plugin you need to get this working. 08:52:45
@drupol:matrix.orgPolI admit that using the Composer Plugin helped us, the new version of the builder doesn't need it anymore so it will be easier. Totally.08:53:10
@drupol:matrix.orgPolI rebased https://github.com/NixOS/nixpkgs/pull/308059 and set it as ready for review. I didn't took care of that for a couple of weeks and when I gave it a look this morning, I don't see anything that I would change. Ready for review now :)09:50:03
@drupol:matrix.orgPol * I rebased https://github.com/NixOS/nixpkgs/pull/308059 and set it as ready for review. I didn't take care of that PR for a couple of weeks and when I gave it a look this morning, I don't see anything that I would change. Ready for review now :)10:37:24
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz

When I do that I get this:

Executing composerInstallBuildHook
Setting COMPOSER_ROOT_VERSION to 6.1.18
New "composer.lock" has been successfully created in /nix/store/nh1p9v51farsza0cq1vpdgqxfs6qkx3d-firefly-iii-6.1.18-composer-repository
Finished composerInstallBuildHook
no Makefile or custom buildPhase, doing nothing
@nix { "action": "setPhase", "phase": "installPhase" }
Running phase: installPhase
Executing composerInstallInstallHook
Setting COMPOSER_ROOT_VERSION to 6.1.18
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 178 installs, 0 updates, 0 removals
    Failed to download phpstan/phpstan from dist: Source path "/nix/store/nh1p9v51farsza0cq1vpdgqxfs6qkx3d-firefly-iii-6.1.18-composer-repository/>
    Now trying to download from source
  - Syncing phpstan/phpstan (1.11.5) into cache

In Git.php line 473:

  Failed to clone https://github.com/phpstan/phpstan.git via https, ssh proto
  cols, aborting.

  - https://github.com/phpstan/phpstan.git
    fatal: could not create leading directories of '/nix/store/7238h8vdl69gyb
  vp9d185vgkmammjv9q-nix-community-composer-local-repo-plugin-vendor-1.1.0/ca
  che/vcs/https---github.com-phpstan-phpstan.git'

  - git@github.com:phpstan/phpstan.git
    fatal: could not create leading directories of '/nix/store/7238h8vdl69gyb
  vp9d185vgkmammjv9q-nix-community-composer-local-repo-plugin-vendor-1.1.0/ca
  che/vcs/https---github.com-phpstan-phpstan.git'

16:40:06
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz I think there's a lot of footguns to using php.composer.composerInstallHook as given in the example. I had to set env.COMPOSER_CACHE_DIR = "/dev/null"; to get stuff to work. 17:18:24
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz And it still doesn't access the network to create the repository, unlike when using php.buildComposerProject. 17:59:06
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz * I think there's a lot of footguns to using php.composer.composerInstallHook as given in the docs. I had to set env.COMPOSER_CACHE_DIR = "/dev/null"; to get stuff to work. 18:08:25
@drupol:matrix.orgPolI will need to check it out carefully when I have a bit of time. If you could put online what you did already that would help me.20:01:33
23 Jun 2024
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz Pol: https://paste.go7box.xyz/?e5acb02c5b224b0d#3uPi4ZvLdaW3BfQCvmwML4KmKmijbKQh7HGTLHK1vZ32 03:46:56
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz These are the contents of pkgs/by-name/fi/firefly-iii/package.nix in my local copy of nixpkgs. 03:47:54
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz I try to build this using nix shell --impure --expr 'with import ./. {}; firefly-iii'. Everything else is standard nixpkgs 03:48:20
@drupol:matrix.orgPolI'll see what I can do07:31:52
@drupol:matrix.orgPolThis week is very hectic for me, I got my Master Thesis defense on Saturday morning, I'm very very busy... 07:32:14
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz Good luck Pol ! 08:09:00
@drupol:matrix.orgPolThank you08:09:06
24 Jun 2024
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzWas able to get it to work https://github.com/NixOS/nixpkgs/pull/32219917:19:08
25 Jun 2024
@patka_123:matrix.orgpatka (new account: @patka:envs.net) changed their display name from patka to patka (new account: @patka:envs.net).08:42:10
@patka:envs.netpatka joined the room.08:56:41

Show newer messages


Back to Room ListRoom Version: 6