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 composerRepositoryHook = makeSetupHook {
19 name = "composer-repository-hook.sh";
20 propagatedNativeBuildInputs = [
21 jq
22 ];
23 propagatedBuildInputs = [
24 cacert
25 ];
26 substitutions = {
27 phpScriptUtils = lib.getExe php-script-utils;
28 };
29 } ./composer-repository-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
47 composerWithPluginVendorHook = makeSetupHook {
48 name = "composer-with-plugin-vendor-hook.sh";
49 propagatedNativeBuildInputs = [
50 jq
51 ];
52 propagatedBuildInputs = [
53 cacert
54 ];
55 substitutions = {
56 # Specify the stdenv's `diff` by abspath to ensure that the user's build
57 # inputs do not cause us to find the wrong `diff`.
58 cmp = "${lib.getBin buildPackages.diffutils}/bin/cmp";
59 phpScriptUtils = lib.getExe php-script-utils;
60 };
61 } ./composer-with-plugin-vendor-hook.sh;
62}