Merge pull request #313600 from fabaff/nray-darwin
[NixPkgs.git] / doc / hooks / zig.section.md
blob8bef293769e58df6d646b9de733e4fb973dd9186
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
15 stdenv.mkDerivation {
16   # . . .
18   nativeBuildInputs = [
19     zig.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`