nixpkgs/doc/hooks/zig.section.md
Anderson Torres eea12fdf8c doc/hooks/zig.section.md: rewrite
- Normalize header IDs, in order to not cause conflicts with identically named
  headers in other docs.
- Reorganize the hierarchy of information.
2023-09-10 16:23:27 -03:00

1.5 KiB

zig.hook

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.

In Nixpkgs, zig.hook overrides the default build, check and install phases.

Example code snippet

{ lib
, stdenv
, zig_0_11
}:

stdenv.mkDerivation {
  # . . .

  nativeBuildInputs = [
    zig_0_11.hook
  ];

  zigBuildFlags = [ "-Dman-pages=true" ];

  dontUseZigCheck = true;

  # . . .
}

Variables controlling zig.hook

zig.hook Exclusive Variables

The variables below are exclusive to zig.hook.

dontUseZigBuild

Disables using zigBuildPhase.

dontUseZigCheck

Disables using zigCheckPhase.

dontUseZigInstall

Disables using zigInstallPhase.

Similar variables

The following variables are similar to their stdenv.mkDerivation counterparts.

zig.hook Variable stdenv.mkDerivation Counterpart
zigBuildFlags buildFlags
zigCheckFlags checkFlags
zigInstallFlags installFlags

Variables honored by zig.hook

The following variables commonly used by stdenv.mkDerivation are honored by zig.hook.

  • prefixKey
  • dontAddPrefix