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 = [
20 zig.hook
21 ];
22
23 zigBuildFlags = [ "-Dman-pages=true" ];
24
25 dontUseZigCheck = true;
26
27 # . . .
28}
29```
30
31## Variables controlling zig.hook {#zig-hook-variables-controlling}
32
33### `zig.hook` Exclusive Variables {#zig-hook-exclusive-variables}
34
35The variables below are exclusive to `zig.hook`.
36
37#### `dontUseZigBuild` {#dont-use-zig-build}
38
39Disables using `zigBuildPhase`.
40
41#### `dontUseZigCheck` {#dont-use-zig-check}
42
43Disables using `zigCheckPhase`.
44
45#### `dontUseZigInstall` {#dont-use-zig-install}
46
47Disables using `zigInstallPhase`.
48
49### Similar variables {#zig-hook-similar-variables}
50
51The following variables are similar to their `stdenv.mkDerivation` counterparts.
52
53| `zig.hook` Variable | `stdenv.mkDerivation` Counterpart |
54|---------------------|-----------------------------------|
55| `zigBuildFlags` | `buildFlags` |
56| `zigCheckFlags` | `checkFlags` |
57| `zigInstallFlags` | `installFlags` |
58
59### Variables honored by zig.hook {#zig-hook-variables-honored}
60
61The following variables commonly used by `stdenv.mkDerivation` are honored by `zig.hook`.
62
63- `prefixKey`
64- `dontAddPrefix`