depot/third_party/nixpkgs/pkgs/development/compilers/zig/hook.nix
Default email d5f4a57cbf Project import generated by Copybara.
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
2023-08-10 09:59:29 +02:00

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