mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 02:44:05 +01:00
This allows users to put zig in their `mkShell` without ending up with a ZIG_GLOBAL_CACHE_DIR value set that points back to a location that only would exist in the sandbox.
1.7 KiB
1.7 KiB
Zig
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.
In Nixpkgs, zig overrides the default build, check and install phases.
Example code snippet
{
lib,
stdenv,
zig,
}:
stdenv.mkDerivation {
# . . .
nativeBuildInputs = [ zig ];
zigBuildFlags = [ "-Dman-pages=true" ];
dontUseZigCheck = true;
# . . .
}
Variables controlling zig
zig Exclusive Variables
The variables below are exclusive to zig.
dontUseZigConfigure
Disables using zigConfigurePhase.
dontUseZigBuild
Disables using zigBuildPhase.
dontUseZigCheck
Disables using zigCheckPhase.
dontUseZigInstall
Disables using zigInstallPhase.
dontSetZigDefaultFlags
Disables using a set of default flags when performing zig builds.
Similar variables
The following variables are similar to their stdenv.mkDerivation counterparts.
zig Variable |
stdenv.mkDerivation Counterpart |
|---|---|
zigBuildFlags |
buildFlags |
zigCheckFlags |
checkFlags |
zigInstallFlags |
installFlags |
Variables honored by zig
The following variables commonly used by stdenv.mkDerivation are honored by zig.
prefixKeydontAddPrefix