diff options
author | zimbatm <zimbatm@zimbatm.com> | 2020-10-09 12:44:23 +0200 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2020-10-09 16:55:30 +0200 |
commit | c79ff8ddca6a18fc04873221ed2544c41993cd2c (patch) | |
tree | 22f41a43f19ef67cec700b457376080d32869249 /pkgs/applications/networking/cluster/terraform-providers | |
parent | 3f49e5ba03db71ca54deac6dfcf73b8e25356b76 (diff) |
terraform: fix withPlugins
Move the providerSourceAddress fallback to the terraform.withPlugins
function. Since plugins can be arbitrary derivations, there is no
guarantee that this attribute will be exposed.
While doing that I also cleaned the toDrv function to only pass
attributes to the builder which are required by the build.
The Terraform 0.13 fallback slug has changed from
`nixpkgs/<provider-owner>/<provider-name>` to `nixpkgs/<provider-name>`
as the owner is also not always available. As a nixpkgs user, all I know
is that the provider is in nixpkgs and his name, the owner information
is not necessarily easy to get by.
Diffstat (limited to 'pkgs/applications/networking/cluster/terraform-providers')
-rw-r--r-- | pkgs/applications/networking/cluster/terraform-providers/default.nix | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/pkgs/applications/networking/cluster/terraform-providers/default.nix b/pkgs/applications/networking/cluster/terraform-providers/default.nix index d6426a2314c4..73fc6df024e6 100644 --- a/pkgs/applications/networking/cluster/terraform-providers/default.nix +++ b/pkgs/applications/networking/cluster/terraform-providers/default.nix @@ -8,24 +8,18 @@ let list = lib.importJSON ./providers.json; toDrv = name: data: - let - fallbackProviderSourceAddress = "nixpkgs/${data.owner}/${name}"; - providerSourceAddress = data.provider-source-address or fallbackProviderSourceAddress; - in - buildGoPackage rec { - inherit (data) owner repo rev version sha256; - name = "${repo}-${version}"; - goPackagePath = "github.com/${owner}/${repo}"; + buildGoPackage { + pname = data.repo; + version = data.version; + goPackagePath = "github.com/${data.owner}/${data.repo}"; subPackages = [ "." ]; src = fetchFromGitHub { - inherit owner repo rev sha256; + 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/${repo}{,_v${version}}"; - passthru = { - inherit providerSourceAddress; - }; + postBuild = "mv $NIX_BUILD_TOP/go/bin/${data.repo}{,_v${data.version}}"; + passthru = data; }; # Google is now using the vendored go modules, which works a bit differently |