git.iko.soy/typeable/nixpkgs
on master help sign in
vagrant-libvirt: init at 2.2.0

Adds a flag and a new package to build vagrant with libvirt support, to be able to install and use the vagrant-libvirt plugin.

commit7ed92b1497818a2c8d0f17769b126be8fbc620c2 authorChristian Albrecht <christian.albrecht@mayflower.de> dateSat 27 Oct 2018, 08:28 (8 years ago) parent9335613
3 files changed+31−4
pkgs/development/tools/vagrant/default.nix+11−4 pkgs/development/tools/vagrant/gemset_libvirt.nix+19 pkgs/top-level/all-packages.nix+1
pkgs/development/tools/vagrant/default.nix+11−4
@@ -1,4 +1,4 @@
1−{ lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive, writeText }:
1+{ lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive, writeText, withLibvirt ? false, libvirt, pkgconfig }:
22
33let
44 # NOTE: bumping the version and updating the hash is insufficient;
@@ -15,7 +15,7 @@ let
1515 inherit ruby;
1616 gemfile = writeText "Gemfile" "";
1717 lockfile = writeText "Gemfile.lock" "";
18− gemset = lib.recursiveUpdate (import ./gemset.nix) {
18+ gemset = lib.recursiveUpdate (import ./gemset.nix) ({
1919 vagrant = {
2020 source = {
2121 type = "url";
@@ -23,7 +23,7 @@ let
2323 };
2424 inherit version;
2525 };
26− };
26+ } // lib.optionalAttrs withLibvirt (import ./gemset_libvirt.nix));
2727 };
2828
2929in buildRubyGem rec {
@@ -35,6 +35,8 @@ in buildRubyGem rec {
3535 dontBuild = false;
3636 src = fetchurl { inherit url sha256; };
3737
38+ buildInputs = lib.optional withLibvirt [ libvirt pkgconfig ];
39+
3840 patches = [
3941 ./unofficial-installation-nowarn.patch
4042 ./use-system-bundler-version.patch
@@ -45,7 +47,12 @@ in buildRubyGem rec {
4547 postInstall = ''
4648 wrapProgram "$out/bin/vagrant" \
4749 --set GEM_PATH "${deps}/lib/ruby/gems/${ruby.version.libDir}" \
48− --prefix PATH ':' "${lib.getBin libarchive}/bin"
50+ --prefix PATH ':' "${lib.getBin libarchive}/bin" \
51+ ${lib.optionalString withLibvirt ''
52+ --prefix PATH ':' "${pkgconfig}/bin" \
53+ --prefix PKG_CONFIG_PATH ':' \
54+ "${lib.makeSearchPath "lib/pkgconfig" [ libvirt ]}"
55+ ''}
4956 '';
5057
5158 installCheckPhase = ''
pkgs/development/tools/vagrant/gemset_libvirt.nixnew file+19
@@ -0,0 +1,19 @@
1+{
2+ mini_portile2 = {
3+ source = {
4+ remotes = ["https://rubygems.org"];
5+ sha256 = "0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y";
6+ type = "gem";
7+ };
8+ version = "2.3.0";
9+ };
10+ nokogiri = {
11+ dependencies = ["mini_portile2"];
12+ source = {
13+ remotes = ["https://rubygems.org"];
14+ sha256 = "0byyxrazkfm29ypcx5q4syrv126nvjnf7z6bqi01sqkv4llsi4qz";
15+ type = "gem";
16+ };
17+ version = "1.8.5";
18+ };
19+}
pkgs/top-level/all-packages.nix+1
@@ -8990,6 +8990,7 @@ with pkgs;
89908990 universal-ctags = callPackage ../development/tools/misc/universal-ctags { };
89918991
89928992 vagrant = callPackage ../development/tools/vagrant {};
8993+ vagrant-libvirt = self.vagrant.override { withLibvirt = true; };
89938994
89948995 bashdb = callPackage ../development/tools/misc/bashdb { };
89958996