diff --git a/default.nix b/default.nix index 22a1495..917ab49 100644 --- a/default.nix +++ b/default.nix @@ -13,6 +13,9 @@ let dockerImage = callPackage ./pkgs/dockerImage.nix { }; srcNoTarget = import ./pkgs/srcNoTarget.nix; + # zig + zig = callPackage ./pkgs/zig.nix { }; + # other MoonPlus = callPackage ./pkgs/moonplus { }; minica = callPackage ./pkgs/minica { }; diff --git a/pkgs/zig.nix b/pkgs/zig.nix new file mode 100644 index 0000000..59a3f7a --- /dev/null +++ b/pkgs/zig.nix @@ -0,0 +1,21 @@ +{ sources ? import ./sources.nix, pkgs ? import sources.nixpkgs { } }: + +version: + +let + src = if pkgs.stdenv.isDarwin then + "https://ziglang.org/builds/zig-macos-x86_64-${version}.tar.xz" + else + "https://ziglang.org/builds/zig-linux-x86_64-${version}.tar.xz"; + +in pkgs.stdenv.mkDerivation { + name = "zig"; + inherit src version; + + installPhase = '' + mkdir -p $out + cp -rf * $out + mkdir -p $out/bin + mv $out/zig $out/bin/zig + ''; +}