2018-09-28 19:28:38 +01:00
|
|
|
{ lib
|
|
|
|
, buildGoPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, callPackage
|
|
|
|
}:
|
2017-09-01 15:49:24 +01:00
|
|
|
let
|
|
|
|
list = import ./data.nix;
|
2017-09-08 19:36:43 +01:00
|
|
|
|
|
|
|
toDrv = data:
|
2017-09-01 15:49:24 +01:00
|
|
|
buildGoPackage rec {
|
2017-09-08 19:36:43 +01:00
|
|
|
inherit (data) owner repo version sha256;
|
|
|
|
name = "${repo}-${version}";
|
|
|
|
goPackagePath = "github.com/${owner}/${repo}";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit owner repo sha256;
|
|
|
|
rev = "v${version}";
|
|
|
|
};
|
2018-02-06 21:09:22 +00:00
|
|
|
|
|
|
|
# Terraform allow checking the provider versions, but this breaks
|
|
|
|
# if the versions are not provided via file paths.
|
|
|
|
postBuild = "mv go/bin/${repo}{,_v${version}}";
|
2017-09-01 15:49:24 +01:00
|
|
|
};
|
|
|
|
in
|
2018-09-28 19:28:38 +01:00
|
|
|
{
|
|
|
|
ibm = callPackage ./ibm {};
|
|
|
|
libvirt = callPackage ./libvirt {};
|
|
|
|
} // lib.mapAttrs (n: v: toDrv v) list
|