From 1b4eb641e62bd49c60858fb45183e07efa0bd212 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 30 Mar 2024 05:07:54 +0100 Subject: [PATCH] rebase package --- packages/simplesamlphp/default.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/simplesamlphp/default.nix b/packages/simplesamlphp/default.nix index 9cef217..8f38742 100644 --- a/packages/simplesamlphp/default.nix +++ b/packages/simplesamlphp/default.nix @@ -1,9 +1,9 @@ -{ php +{ lib +, php , writeText , fetchFromGitHub -, configFile ? "config/config.php.dist" -, authsourcesFile ? "config/authsources.php.dist" -, saml20-idp-remoteFile ? writeText "saml20-idp-remote.php" "" +, extra_files ? { } + }: php.buildComposerProject rec { @@ -24,11 +24,10 @@ php.buildComposerProject rec { # TODO: metadata could be fetched automagically with these: # - https://simplesamlphp.org/docs/contrib_modules/metarefresh/simplesamlphp-automated_metadata.html # - https://idp.pvv.ntnu.no/simplesaml/saml2/idp/metadata.php - postPatch = '' - install -Dm444 "${configFile}" "config/config.php" - install -Dm444 "${authsourcesFile}" "config/authsources.php" - install -Dm444 "${saml20-idp-remoteFile}" "metadata/saml20-idp-remote.php" - ''; + postPatch = lib.pipe extra_files [ + (lib.mapAttrsToList (target_path: source_path: ''install -Dm444 "${source_path}" "${target_path}"'')) + (lib.concatStringsSep "\n") + ]; postInstall = '' ln -sr $out/share/php/simplesamlphp/vendor/simplesamlphp/simplesamlphp-assets-base $out/share/php/simplesamlphp/public/assets/base