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