1 # pkgs.makeSetupHook {#sec-pkgs.makeSetupHook}
3 `pkgs.makeSetupHook` is a build helper that produces hooks that go in to `nativeBuildInputs`
5 ## Usage {#sec-pkgs.makeSetupHook-usage}
9 name = "something-hook";
10 propagatedBuildInputs = [ pkgs.commandsomething ];
11 depsTargetTargetPropagated = [ pkgs.libsomething ];
15 ### setup hook that depends on the hello package and runs hello and @shell@ is substituted with path to bash {#sec-pkgs.makeSetupHook-usage-example}
20 name = "run-hello-hook";
21 # Put dependencies here if they have hooks or necessary dependencies propagated
22 # otherwise prefer direct paths to executables.
23 propagatedBuildInputs = [
28 shell = "${pkgs.bash}/bin/bash";
29 cowsay = "${pkgs.cowsay}/bin/cowsay";
33 writeScript "run-hello-hook.sh" ''
35 # the direct path to the executable has to be here because
36 # this will be run when the file is sourced
37 # at which point '$PATH' has not yet been populated with inputs
43 preConfigureHooks+=(_printHelloHook)
48 ## Attributes {#sec-pkgs.makeSetupHook-attributes}
50 * `name` Set the name of the hook.
51 * `propagatedBuildInputs` Runtime dependencies (such as binaries) of the hook.
52 * `depsTargetTargetPropagated` Non-binary dependencies.
55 * `substitutions` Variables for `substituteAll`