8d6fcbe1a5
Change-Id: Ie7f52367ef91c0c8017a36c2a6c7edb06f10e57d Reviewed-on: https://cl.tvl.fyi/c/depot/+/1589 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
24 lines
548 B
Nix
24 lines
548 B
Nix
{ pkgs, ... }:
|
|
|
|
{ path, version, sha256 }:
|
|
|
|
(pkgs.fetchurl {
|
|
name = "source";
|
|
url = "https://proxy.golang.org/${path}/@v/v${version}.zip";
|
|
inherit sha256;
|
|
|
|
recursiveHash = true;
|
|
downloadToTemp = true;
|
|
|
|
postFetch = ''
|
|
unpackDir="$TMPDIR/unpack"
|
|
mkdir "$unpackDir"
|
|
cd "$unpackDir"
|
|
|
|
mv "$downloadedFile" "$TMPDIR/src.zip"
|
|
unpackFile "$TMPDIR/src.zip"
|
|
mv "$unpackDir/${path}@v${version}" "$out"
|
|
'';
|
|
}).overrideAttrs ({ nativeBuildInputs ? [], ... }: {
|
|
nativeBuildInputs = nativeBuildInputs ++ [ pkgs.unzip ];
|
|
})
|