about summary refs log tree commit diff
path: root/pkgs/development/compilers/zig/0.13/hook.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/zig/0.13/hook.nix')
-rw-r--r--pkgs/development/compilers/zig/0.13/hook.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/development/compilers/zig/0.13/hook.nix b/pkgs/development/compilers/zig/0.13/hook.nix
new file mode 100644
index 0000000000000..a56b1a21e961d
--- /dev/null
+++ b/pkgs/development/compilers/zig/0.13/hook.nix
@@ -0,0 +1,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