2023-08-10 02:43:09 +02:00
|
|
|
# zig.hook {#zig-hook}
|
2023-07-15 07:55:32 +02:00
|
|
|
|
|
|
|
[Zig](https://ziglang.org/) is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.
|
|
|
|
|
2023-08-10 02:43:09 +02:00
|
|
|
In Nixpkgs, `zig.hook` overrides the default build, check and install phases.
|
2023-07-15 07:55:32 +02:00
|
|
|
|
|
|
|
## Example code snippet {#example-code-snippet}
|
|
|
|
|
|
|
|
```nix
|
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-08-10 02:55:18 +02:00
|
|
|
, zig_0_11
|
2023-07-15 07:55:32 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
# . . .
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-08-10 02:55:18 +02:00
|
|
|
zig_0_11.hook
|
2023-07-15 07:55:32 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
zigBuildFlags = [ "-Dman-pages=true" ];
|
|
|
|
|
|
|
|
dontUseZigCheck = true;
|
|
|
|
|
|
|
|
# . . .
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-08-10 02:43:09 +02:00
|
|
|
## Variables controlling zig.hook {#variables-controlling-zig-hook}
|
2023-07-15 07:55:32 +02:00
|
|
|
|
|
|
|
### `dontUseZigBuild` {#dontUseZigBuild}
|
|
|
|
|
|
|
|
Disables using `zigBuildPhase`.
|
|
|
|
|
|
|
|
### `zigBuildFlags` {#zigBuildFlags}
|
|
|
|
|
|
|
|
Controls the flags passed to the build phase.
|
|
|
|
|
|
|
|
### `dontUseZigCheck` {#dontUseZigCheck}
|
|
|
|
|
|
|
|
Disables using `zigCheckPhase`.
|
|
|
|
|
|
|
|
### `zigCheckFlags` {#zigCheckFlags}
|
|
|
|
|
|
|
|
Controls the flags passed to the check phase.
|
|
|
|
|
|
|
|
### `dontUseZigInstall` {#dontUseZigInstall}
|
|
|
|
|
|
|
|
Disables using `zigInstallPhase`.
|
|
|
|
|
|
|
|
### `zigInstallFlags` {#zigInstallFlags}
|
|
|
|
|
|
|
|
Controls the flags passed to the install phase.
|
|
|
|
|
2023-08-10 02:43:09 +02:00
|
|
|
### Variables honored by zig.hook {#variables-honored-by-zig-hook}
|
2023-07-15 07:55:32 +02:00
|
|
|
|
|
|
|
- `prefixKey`
|
|
|
|
- `dontAddPrefix`
|