2023-01-28 20:57:21 +01:00
|
|
|
# pkgs.makeSetupHook {#sec-pkgs.makeSetupHook}
|
|
|
|
|
|
|
|
`pkgs.makeSetupHook` is a builder that produces hooks that go in to `nativeBuildInputs`
|
|
|
|
|
|
|
|
## Usage {#sec-pkgs.makeSetupHook-usage}
|
|
|
|
|
|
|
|
```nix
|
|
|
|
pkgs.makeSetupHook {
|
|
|
|
name = "something-hook";
|
|
|
|
propagatedBuildInputs = [ pkgs.commandsomething ];
|
|
|
|
depsTargetTargetPropagated = [ pkgs.libsomething ];
|
|
|
|
} ./script.sh
|
|
|
|
```
|
|
|
|
|
2023-06-10 17:54:02 +02:00
|
|
|
### setup hook that depends on the hello package and runs hello and @shell@ is substituted with path to bash {#sec-pkgs.makeSetupHook-usage-example}
|
2023-01-28 20:57:21 +01:00
|
|
|
|
|
|
|
```nix
|
|
|
|
pkgs.makeSetupHook {
|
|
|
|
name = "run-hello-hook";
|
|
|
|
propagatedBuildInputs = [ pkgs.hello ];
|
|
|
|
substitutions = { shell = "${pkgs.bash}/bin/bash"; };
|
|
|
|
passthru.tests.greeting = callPackage ./test { };
|
|
|
|
meta.platforms = lib.platforms.linux;
|
|
|
|
} (writeScript "run-hello-hook.sh" ''
|
|
|
|
#!@shell@
|
|
|
|
hello
|
|
|
|
'')
|
|
|
|
```
|
|
|
|
|
2023-03-27 22:39:11 +02:00
|
|
|
## Attributes {#sec-pkgs.makeSetupHook-attributes}
|
2023-01-28 20:57:21 +01:00
|
|
|
|
|
|
|
* `name` Set the name of the hook.
|
|
|
|
* `propagatedBuildInputs` Runtime dependencies (such as binaries) of the hook.
|
|
|
|
* `depsTargetTargetPropagated` Non-binary dependencies.
|
|
|
|
* `meta`
|
|
|
|
* `passthru`
|
|
|
|
* `substitutions` Variables for `substituteAll`
|