about summary refs log tree commit diff
path: root/pkgs/development/compilers/zig/0.13/hook.nix
blob: a56b1a21e961db1851efdd64e66a597320d7d38e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  lib,
  makeSetupHook,
  zig,
}:

makeSetupHook {
  name = "zig-hook";

  propagatedBuildInputs = [ zig ];

  substitutions = {
    # This zig_default_flags below is meant to avoid CPU feature impurity in
    # Nixpkgs. However, this flagset is "unstable": it is specifically meant to
    # be controlled by the upstream development team - being up to that team
    # exposing or not that flags to the outside (especially the package manager
    # teams).
    zig_default_flags = [
      "-Dcpu=baseline"
      "--release=safe"
    ];
  };

  passthru = {
    inherit zig;
  };

  meta = {
    description = "A setup hook for using the Zig compiler in Nixpkgs";
    inherit (zig.meta) maintainers platforms broken;
  };
} ./setup-hook.sh