depot/third_party/nixpkgs/doc/hooks/zig.section.md
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02: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
}:

stdenv.mkDerivation {
  # . . .

  nativeBuildInputs = [
    zig.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