terraform-providers: remove buildGoPackage
all providers are now using buildGoModule
This commit is contained in:
parent
617c643edb
commit
1cd34071df
1 changed files with 2 additions and 20 deletions
|
@ -1,6 +1,5 @@
|
||||||
{ lib
|
{ lib
|
||||||
, buildGoModule
|
, buildGoModule
|
||||||
, buildGoPackage
|
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, callPackage
|
, callPackage
|
||||||
, config
|
, config
|
||||||
|
@ -11,13 +10,12 @@ let
|
||||||
buildWithGoModule = data:
|
buildWithGoModule = data:
|
||||||
buildGoModule {
|
buildGoModule {
|
||||||
pname = data.repo;
|
pname = data.repo;
|
||||||
version = data.version;
|
inherit (data) vendorSha256 version;
|
||||||
subPackages = [ "." ];
|
subPackages = [ "." ];
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
inherit (data) owner repo rev sha256;
|
inherit (data) owner repo rev sha256;
|
||||||
};
|
};
|
||||||
vendorSha256 = data.vendorSha256 or null;
|
|
||||||
deleteVendor = data.deleteVendor or false;
|
deleteVendor = data.deleteVendor or false;
|
||||||
proxyVendor = data.proxyVendor or false;
|
proxyVendor = data.proxyVendor or false;
|
||||||
|
|
||||||
|
@ -27,25 +25,9 @@ let
|
||||||
passthru = data;
|
passthru = data;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildWithGoPackage = data:
|
|
||||||
buildGoPackage {
|
|
||||||
pname = data.repo;
|
|
||||||
version = data.version;
|
|
||||||
goPackagePath = "github.com/${data.owner}/${data.repo}";
|
|
||||||
subPackages = [ "." ];
|
|
||||||
doCheck = false;
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
inherit (data) owner repo rev sha256;
|
|
||||||
};
|
|
||||||
# Terraform allow checking the provider versions, but this breaks
|
|
||||||
# if the versions are not provided via file paths.
|
|
||||||
postBuild = "mv $NIX_BUILD_TOP/go/bin/${data.repo}{,_v${data.version}}";
|
|
||||||
passthru = data;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Our generic constructor to build new providers
|
# Our generic constructor to build new providers
|
||||||
mkProvider = attrs:
|
mkProvider = attrs:
|
||||||
(if (lib.hasAttr "vendorSha256" attrs) then buildWithGoModule else buildWithGoPackage)
|
(if (lib.hasAttr "vendorSha256" attrs) then buildWithGoModule else throw /* added 2022/01 */ "vendorSha256 missing: please use `buildGoModule`")
|
||||||
attrs;
|
attrs;
|
||||||
|
|
||||||
# These providers are managed with the ./update-all script
|
# These providers are managed with the ./update-all script
|
||||||
|
|
Loading…
Reference in a new issue