d5f4a57cbf
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
25 lines
504 B
Nix
25 lines
504 B
Nix
{ lib
|
|
, makeSetupHook
|
|
, zig
|
|
}:
|
|
|
|
makeSetupHook {
|
|
name = "zig-hook";
|
|
|
|
propagatedBuildInputs = [ zig ];
|
|
|
|
substitutions = {
|
|
zig_default_flags =
|
|
if lib.versionAtLeast zig.version "0.11" then
|
|
"-Doptimize=ReleaseSafe -Dcpu=baseline"
|
|
else
|
|
"-Drelease-safe=true -Dcpu=baseline";
|
|
};
|
|
|
|
passthru = { inherit zig; };
|
|
|
|
meta = {
|
|
description = "A setup hook for using the Zig compiler in Nixpkgs";
|
|
inherit (zig.meta) maintainers platforms broken;
|
|
};
|
|
} ./setup-hook.sh
|