1# pkgs.makeSetupHook {#sec-pkgs.makeSetupHook}
2
3`pkgs.makeSetupHook` is a build helper that produces hooks that go in to `nativeBuildInputs`
4
5## Usage {#sec-pkgs.makeSetupHook-usage}
6
7```nix
8pkgs.makeSetupHook {
9 name = "something-hook";
10 propagatedBuildInputs = [ pkgs.commandsomething ];
11 depsTargetTargetPropagated = [ pkgs.libsomething ];
12} ./script.sh
13```
14
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}
16
17```nix
18pkgs.makeSetupHook {
19 name = "run-hello-hook";
20 propagatedBuildInputs = [ pkgs.hello ];
21 substitutions = { shell = "${pkgs.bash}/bin/bash"; };
22 passthru.tests.greeting = callPackage ./test { };
23 meta.platforms = lib.platforms.linux;
24} (writeScript "run-hello-hook.sh" ''
25 #!@shell@
26 hello
27'')
28```
29
30## Attributes {#sec-pkgs.makeSetupHook-attributes}
31
32* `name` Set the name of the hook.
33* `propagatedBuildInputs` Runtime dependencies (such as binaries) of the hook.
34* `depsTargetTargetPropagated` Non-binary dependencies.
35* `meta`
36* `passthru`
37* `substitutions` Variables for `substituteAll`