From 086143216b44287254e224adb35fd0196fbd7a37 Mon Sep 17 00:00:00 2001 From: Sandro Date: Sat, 2 Nov 2024 20:56:18 +0100 Subject: [PATCH] Try to fix build by using buildComposerProject2 (#5) --- derivation.nix | 21 +++++++++++---------- flake.lock | 8 ++++---- flake.nix | 2 +- module.nix | 8 ++++---- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/derivation.nix b/derivation.nix index 4988ffa..5d12c98 100644 --- a/derivation.nix +++ b/derivation.nix @@ -8,7 +8,7 @@ let phpPackage = php82; in -phpPackage.buildComposerProject rec { +phpPackage.buildComposerProject2 rec { pname = "ixp-manager"; version = "6.4.1"; @@ -19,9 +19,11 @@ phpPackage.buildComposerProject rec { sha256 = "sha256-Hgjem/3z3FXWklZTbN0Y+gJEeL6QGGePEd70qC28Ktg="; }; - vendorHash = "sha256-l5DHdjMZT5QfcVDyk02MR0y/yEfZamRwmE9D/ObIEuk="; + # fails because deprecated license identifier was used 🙄 composerStrictValidation = false; + vendorHash = "sha256-NZqljwQOULuTkA6hZ4+71qD0VN8RFVZTi1y8Cq1cBW0="; + patches = [ ./cipher-config.patch (fetchpatch { @@ -34,15 +36,14 @@ phpPackage.buildComposerProject rec { installPhase = '' runHook preInstall - mv $out/share/php/ixp-manager/* $out - rm -r $out/share + ixp_manager_out="$out/share/php/ixp-manager" - rm -rf $out/bootstrap/cache $out/storage $out/.env - ln -s ${dataDir}/.env $out/.env - ln -s ${dataDir}/storage $out/storage - ln -s ${dataDir}/cache $out/bootstrap/cache - ln -s ${dataDir}/skin $out/resources/skins/custom - ln -s ${dataDir}/custom.php $out/config/custom.php + rm -r $ixp_manager_out/bootstrap/cache $ixp_manager_out/storage + ln -s ${dataDir}/.env $ixp_manager_out/.env + ln -s ${dataDir}/storage $ixp_manager_out/storage + ln -s ${dataDir}/cache $ixp_manager_out/bootstrap/cache + ln -s ${dataDir}/skin $ixp_manager_out/resources/skins/custom + ln -s ${dataDir}/custom.php $ixp_manager_out/config/custom.php runHook postInstall ''; diff --git a/flake.lock b/flake.lock index d81e724..d49dd90 100644 --- a/flake.lock +++ b/flake.lock @@ -20,16 +20,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1730137625, - "narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=", + "lastModified": 1730200266, + "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64b80bfb316b57cdb8919a9110ef63393d74382a", + "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index d516d2b..12c4b15 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; diff --git a/module.nix b/module.nix index f70be37..ef37745 100644 --- a/module.nix +++ b/module.nix @@ -58,7 +58,7 @@ let }; artisanWrapper = pkgs.writeShellScriptBin "ixp-manager-artisan" '' - cd ${package} + cd ${package}/share/php/ixp-manager sudo=exec if [[ "$USER" != ${cfg.user} ]]; then sudo='exec /run/wrappers/bin/sudo -u ${cfg.user}' @@ -314,7 +314,7 @@ in virtualHosts."${cfg.hostname}" = mkMerge [ cfg.nginx { - root = mkForce "${package}/public"; + root = mkForce "${package}/share/php/ixp-manager/public"; locations."/" = { index = "index.php"; tryFiles = "$uri $uri/ /index.php?$query_string"; @@ -434,7 +434,7 @@ in # init custom config options if [[ ! -s ${cfg.dataDir}/custom.php ]]; then - cat ${package}/config/custom.php.dist > ${cfg.dataDir}/custom.php + cat ${package}/share/php/ixp-manager/config/custom.php.dist > ${cfg.dataDir}/custom.php fi # init .env file if it is empty @@ -464,7 +464,7 @@ in ${artisanWrapper}/bin/ixp-manager-artisan migrate --force # regenerate views - mysql -h ''$DB_HOST -u ''$DB_USERNAME -p''$DB_PASSWORD ''$DB_DATABASE < ${package}/tools/sql/views.sql + mysql -h ''$DB_HOST -u ''$DB_USERNAME -p''$DB_PASSWORD ''$DB_DATABASE < ${package}/share/php/ixp-manager/tools/sql/views.sql # version file empty --> initial installation if [[ ! -s ${cfg.dataDir}/version ]]; then