2018-03-24 10:58:56 +00:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, libvirt, pkgconfig, makeWrapper, cdrtools }:
|
|
|
|
|
|
|
|
# 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;
|
|
|
|
#
|
|
|
|
# terraform-provider-libvirt does not manage pools at the moment:
|
|
|
|
#
|
|
|
|
# $ virsh --connect "qemu:///system" pool-define-as default dir - - - - /var/lib/libvirt/images
|
|
|
|
# $ virsh --connect "qemu:///system" pool-start default
|
|
|
|
#
|
|
|
|
# pick an example from (i.e ubuntu):
|
|
|
|
# https://github.com/dmacvicar/terraform-provider-libvirt/tree/master/examples
|
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "terraform-provider-libvirt";
|
2020-11-15 19:12:28 +00:00
|
|
|
version = "0.6.3";
|
2018-03-24 10:58:56 +00:00
|
|
|
|
|
|
|
goPackagePath = "github.com/dmacvicar/terraform-provider-libvirt";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dmacvicar";
|
|
|
|
repo = "terraform-provider-libvirt";
|
|
|
|
rev = "v${version}";
|
2020-11-15 19:12:28 +00:00
|
|
|
sha256 = "0ak2lpnv6h0i7lzfcggd90jpfhvsasdr6nflkflk2drlcpalggj9";
|
2018-03-24 10:58:56 +00:00
|
|
|
};
|
|
|
|
|
2020-03-18 13:13:32 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper ];
|
|
|
|
|
|
|
|
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.
|
|
|
|
postBuild = "mv go/bin/terraform-provider-libvirt{,_v${version}}";
|
|
|
|
|
2018-03-24 10:58:56 +00:00
|
|
|
meta = with stdenv.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 ];
|
|
|
|
};
|
|
|
|
}
|