From 8d6fcbe1a5e4791d81d2a83b89407f8d2d4d8362 Mon Sep 17 00:00:00 2001 From: edef Date: Mon, 3 Aug 2020 10:20:48 +0000 Subject: 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 --- nix/fetchGoModule/OWNERS | 2 ++ nix/fetchGoModule/default.nix | 24 ++++++++++++++++++++++++ users/edef/fetchGoModule.nix | 24 ------------------------ users/edef/loxy.nix | 2 +- 4 files changed, 27 insertions(+), 25 deletions(-) create mode 100644 nix/fetchGoModule/OWNERS create mode 100644 nix/fetchGoModule/default.nix delete mode 100644 users/edef/fetchGoModule.nix diff --git a/nix/fetchGoModule/OWNERS b/nix/fetchGoModule/OWNERS new file mode 100644 index 000000000000..47b6a04183a2 --- /dev/null +++ b/nix/fetchGoModule/OWNERS @@ -0,0 +1,2 @@ +owners: + - edef diff --git a/nix/fetchGoModule/default.nix b/nix/fetchGoModule/default.nix new file mode 100644 index 000000000000..e49a5e3a1c5e --- /dev/null +++ b/nix/fetchGoModule/default.nix @@ -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 ]; +}) diff --git a/users/edef/fetchGoModule.nix b/users/edef/fetchGoModule.nix deleted file mode 100644 index e49a5e3a1c5e..000000000000 --- a/users/edef/fetchGoModule.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ 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 ]; -}) diff --git a/users/edef/loxy.nix b/users/edef/loxy.nix index 71750fc45a91..d1399f3ea947 100644 --- a/users/edef/loxy.nix +++ b/users/edef/loxy.nix @@ -2,7 +2,7 @@ let - inherit (depot.users.edef) fetchGoModule; + inherit (depot.nix) fetchGoModule; in -- cgit 1.4.1