mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 12:43:52 +00:00
3b6bef448e
- remove noop `lib.concatStringsSep` - reformat `releaseType` - inline `cpu`
30 lines
571 B
Nix
30 lines
571 B
Nix
{ lib
|
|
, makeSetupHook
|
|
, zig
|
|
}:
|
|
|
|
makeSetupHook {
|
|
name = "zig-hook";
|
|
|
|
propagatedBuildInputs = [ zig ];
|
|
|
|
substitutions = {
|
|
zig_default_flags =
|
|
let
|
|
releaseType =
|
|
if lib.versionAtLeast zig.version "0.11" then
|
|
"-Doptimize=ReleaseSafe"
|
|
else
|
|
"-Drelease-safe=true";
|
|
in
|
|
[ "-Dcpu=baseline" releaseType ];
|
|
};
|
|
|
|
passthru = { inherit zig; };
|
|
|
|
meta = {
|
|
description = "A setup hook for using the Zig compiler in Nixpkgs";
|
|
inherit (zig.meta) maintainers platforms broken;
|
|
};
|
|
} ./setup-hook.sh
|