Skip to content

Commit

Permalink
Try to fix build by using buildComposerProject2 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Nov 2, 2024
1 parent d0e6ee9 commit 0861432
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
21 changes: 11 additions & 10 deletions derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
let
phpPackage = php82;
in
phpPackage.buildComposerProject rec {
phpPackage.buildComposerProject2 rec {
pname = "ixp-manager";
version = "6.4.1";

Expand All @@ -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 {
Expand All @@ -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
'';
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -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";
};

Expand Down
8 changes: 4 additions & 4 deletions module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0861432

Please sign in to comment.