2021-11-02 19:27:41 +00:00
|
|
|
{ buildGoModule, cdrtools, fetchFromGitHub, lib, libvirt, makeWrapper, pkg-config }:
|
2018-03-24 10:58:56 +00:00
|
|
|
|
|
|
|
# USAGE:
|
|
|
|
# install the following package globally or in nix-shell:
|
|
|
|
#
|
2018-10-16 18:35:45 +01:00
|
|
|
# (terraform.withPlugins (p: [p.libvirt]))
|
2018-03-24 10:58:56 +00:00
|
|
|
#
|
|
|
|
# configuration.nix:
|
|
|
|
#
|
|
|
|
# virtualisation.libvirtd.enable = true;
|
|
|
|
#
|
|
|
|
# pick an example from (i.e ubuntu):
|
2021-11-02 19:27:41 +00:00
|
|
|
# https://github.com/dmacvicar/terraform-provider-libvirt/tree/main/examples
|
2018-03-24 10:58:56 +00:00
|
|
|
|
2021-11-02 19:27:41 +00:00
|
|
|
let
|
|
|
|
sha256 = "sha256-8GGPd0+qdw7s4cr0RgLoS0Cu4C+RAuuboZzTyYN/kq8=";
|
|
|
|
vendorSha256 = "sha256-fpO2sGM+VUKLmdfJ9CQfTFnCfxVTK2m9Sirj9oerD/I=";
|
|
|
|
version = "0.6.11";
|
|
|
|
in buildGoModule {
|
|
|
|
inherit version;
|
|
|
|
inherit vendorSha256;
|
2018-03-24 10:58:56 +00:00
|
|
|
|
2021-11-02 19:27:41 +00:00
|
|
|
pname = "terraform-provider-libvirt";
|
2020-09-28 08:07:51 +01:00
|
|
|
|
2018-03-24 10:58:56 +00:00
|
|
|
src = fetchFromGitHub {
|
2021-11-02 19:27:41 +00:00
|
|
|
inherit sha256;
|
|
|
|
|
2018-03-24 10:58:56 +00:00
|
|
|
owner = "dmacvicar";
|
|
|
|
repo = "terraform-provider-libvirt";
|
|
|
|
rev = "v${version}";
|
|
|
|
};
|
|
|
|
|
2021-01-17 02:09:27 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2020-03-18 13:13:32 +00:00
|
|
|
|
|
|
|
buildInputs = [ libvirt ];
|
2018-03-24 10:58:56 +00:00
|
|
|
|
2018-08-03 20:59:18 +01:00
|
|
|
# mkisofs needed to create ISOs holding cloud-init data,
|
|
|
|
# and wrapped to terraform via deecb4c1aab780047d79978c636eeb879dd68630
|
2018-03-24 10:58:56 +00:00
|
|
|
propagatedBuildInputs = [ cdrtools ];
|
|
|
|
|
2018-10-16 18:35:45 +01:00
|
|
|
# Terraform allow checking the provider versions, but this breaks
|
|
|
|
# if the versions are not provided via file paths.
|
2021-11-02 19:27:41 +00:00
|
|
|
postBuild = "mv $GOPATH/bin/terraform-provider-libvirt{,_v${version}}";
|
|
|
|
|
|
|
|
ldflags = [ "-X main.version=${version}" ];
|
|
|
|
passthru.provider-source-address = "registry.terraform.io/dmacvicar/libvirt";
|
|
|
|
|
|
|
|
doCheck = false;
|
2018-10-16 18:35:45 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/dmacvicar/terraform-provider-libvirt";
|
2018-03-24 10:58:56 +00:00
|
|
|
description = "Terraform provider for libvirt";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ mic92 ];
|
|
|
|
};
|
|
|
|
}
|