1# zig.hook {#zig-hook}
2
3[Zig](https://ziglang.org/) is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.
4
5In Nixpkgs, `zig.hook` overrides the default build, check and install phases.
6
7## Example code snippet {#zig-hook-example-code-snippet}
8
9```nix
10{
11 lib,
12 stdenv,
13 zig,
14}:
15
16stdenv.mkDerivation {
17 # . . .
18
19 nativeBuildInputs = [ zig.hook ];
20
21 zigBuildFlags = [ "-Dman-pages=true" ];
22
23 dontUseZigCheck = true;
24
25 # . . .
26}
27```
28
29## Variables controlling zig.hook {#zig-hook-variables-controlling}
30
31### `zig.hook` Exclusive Variables {#zig-hook-exclusive-variables}
32
33The variables below are exclusive to `zig.hook`.
34
35#### `dontUseZigBuild` {#dont-use-zig-build}
36
37Disables using `zigBuildPhase`.
38
39#### `dontUseZigCheck` {#dont-use-zig-check}
40
41Disables using `zigCheckPhase`.
42
43#### `dontUseZigInstall` {#dont-use-zig-install}
44
45Disables using `zigInstallPhase`.
46
47### Similar variables {#zig-hook-similar-variables}
48
49The following variables are similar to their `stdenv.mkDerivation` counterparts.
50
51| `zig.hook` Variable | `stdenv.mkDerivation` Counterpart |
52|---------------------|-----------------------------------|
53| `zigBuildFlags` | `buildFlags` |
54| `zigCheckFlags` | `checkFlags` |
55| `zigInstallFlags` | `installFlags` |
56
57### Variables honored by zig.hook {#zig-hook-variables-honored}
58
59The following variables commonly used by `stdenv.mkDerivation` are honored by `zig.hook`.
60
61- `prefixKey`
62- `dontAddPrefix`