nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 makeSetupHook,
4 jq,
5 writeShellApplication,
6 cacert,
7 buildPackages,
8}:
9
10let
11 php-script-utils = writeShellApplication {
12 name = "php-script-utils";
13 runtimeInputs = [ jq ];
14 text = builtins.readFile ./php-script-utils.bash;
15 };
16in
17{
18 composerVendorHook = makeSetupHook {
19 name = "composer-vendor-hook.sh";
20 propagatedNativeBuildInputs = [
21 jq
22 ];
23 propagatedBuildInputs = [
24 cacert
25 ];
26 substitutions = {
27 phpScriptUtils = lib.getExe php-script-utils;
28 };
29 } ./composer-vendor-hook.sh;
30
31 composerInstallHook = makeSetupHook {
32 name = "composer-install-hook.sh";
33 propagatedNativeBuildInputs = [
34 jq
35 ];
36 propagatedBuildInputs = [
37 cacert
38 ];
39 substitutions = {
40 # Specify the stdenv's `diff` by abspath to ensure that the user's build
41 # inputs do not cause us to find the wrong `diff`.
42 cmp = "${lib.getBin buildPackages.diffutils}/bin/cmp";
43 phpScriptUtils = lib.getExe php-script-utils;
44 };
45 } ./composer-install-hook.sh;
46}