chore(nix/fetchGoModule): Move //users/edef/fetchGoModule to //nix
Change-Id: Ie7f52367ef91c0c8017a36c2a6c7edb06f10e57d Reviewed-on: https://cl.tvl.fyi/c/depot/+/1589 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
6b181d314f
commit
8d6fcbe1a5
3 changed files with 3 additions and 1 deletions
2
nix/fetchGoModule/OWNERS
Normal file
2
nix/fetchGoModule/OWNERS
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
owners:
|
||||
- edef
|
||||
24
nix/fetchGoModule/default.nix
Normal file
24
nix/fetchGoModule/default.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ 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 ];
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue