4d5a95770c
GitOrigin-RevId: 3c5319ad3aa51551182ac82ea17ab1c6b0f0df89
37 lines
1 KiB
Markdown
37 lines
1 KiB
Markdown
# 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
|
|
```
|
|
|
|
#### setup hook that depends on the hello package and runs hello and @shell@ is substituted with path to bash
|
|
|
|
```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
|
|
'')
|
|
```
|
|
|
|
## Attributes
|
|
|
|
* `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`
|