nixpkgs/pkgs/applications/networking/cluster/terraform/providers/default.nix
Raitis 4e63119c54 terraform: add the version component to terraform provider paths (#34497)
Terraform checks the provider versions, but this breaks if the versions
are not provided, as they can be, if the plugins are provided by nix.
2018-02-06 21:09:22 +00:00

25 lines
714 B
Nix

{ stdenv, lib, buildGoPackage, fetchFromGitHub }:
let
list = import ./data.nix;
toDrv = data:
buildGoPackage rec {
inherit (data) owner repo version sha256;
name = "${repo}-${version}";
goPackagePath = "github.com/${owner}/${repo}";
src = fetchFromGitHub {
inherit owner repo sha256;
rev = "v${version}";
};
# 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}}";
};
maybeDrv = name: data:
# azure-classic is an archived repo
if name == "azure-classic" then null
else toDrv data;
in
lib.mapAttrs maybeDrv list