diff --git a/pkgs/zig.nix b/pkgs/zig.nix index c6884d6..588df24 100644 --- a/pkgs/zig.nix +++ b/pkgs/zig.nix @@ -1,14 +1,17 @@ { sources ? import ./sources.nix, pkgs ? import sources.nixpkgs { } }: -version: sha256: +version: shasums: let - url = 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"; + attrs = if pkgs.stdenv.isDarwin then { + url = "https://ziglang.org/builds/zig-macos-x86_64-${version}.tar.xz"; + sha256 = shasums.mac; + } else { + url = "https://ziglang.org/builds/zig-linux-x86_64-${version}.tar.xz"; + sha256 = shasums.linux; + }; - src = pkgs.fetchurl { inherit sha256 url; }; + src = pkgs.fetchurl attrs; in pkgs.stdenv.mkDerivation { name = "zig";