jql: 7.0.6 -> 7.0.7
[NixPkgs.git] / doc / hooks / zig.section.md
blob1a09491649d7fc18be96b0fc4c4259f5c830a651
1 # zig.hook {#zig-hook}
3 [Zig](https://ziglang.org/) is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.
5 In Nixpkgs, `zig.hook` overrides the default build, check and install phases.
7 ## Example code snippet {#zig-hook-example-code-snippet}
9 ```nix
10 { lib
11 , stdenv
12 , zig_0_11
15 stdenv.mkDerivation {
16   # . . .
18   nativeBuildInputs = [
19     zig_0_11.hook
20   ];
22   zigBuildFlags = [ "-Dman-pages=true" ];
24   dontUseZigCheck = true;
26   # . . .
28 ```
30 ## Variables controlling zig.hook {#zig-hook-variables-controlling}
32 ### `zig.hook` Exclusive Variables {#zig-hook-exclusive-variables}
34 The variables below are exclusive to `zig.hook`.
36 #### `dontUseZigBuild` {#dont-use-zig-build}
38 Disables using `zigBuildPhase`.
40 #### `dontUseZigCheck` {#dont-use-zig-check}
42 Disables using `zigCheckPhase`.
44 #### `dontUseZigInstall` {#dont-use-zig-install}
46 Disables using `zigInstallPhase`.
48 ### Similar variables {#zig-hook-similar-variables}
50 The following variables are similar to their `stdenv.mkDerivation` counterparts.
52 | `zig.hook` Variable | `stdenv.mkDerivation` Counterpart |
53 |---------------------|-----------------------------------|
54 | `zigBuildFlags`     | `buildFlags`                      |
55 | `zigCheckFlags`     | `checkFlags`                      |
56 | `zigInstallFlags`   | `installFlags`                    |
58 ### Variables honored by zig.hook {#zig-hook-variables-honored}
60 The following variables commonly used by `stdenv.mkDerivation` are honored by `zig.hook`.
62 - `prefixKey`
63 - `dontAddPrefix`