diff options
author | Ryan Fitzsimon <ryanfitzsimon@outlook.com> | 2019-01-02 14:03:20 +1000 |
---|---|---|
committer | Ryan Fitzsimon <ryanfitzsimon@outlook.com> | 2019-01-02 17:17:14 +1000 |
commit | b66b0c58cae9e9f7e400f61de01c078b9466934d (patch) | |
tree | a9c4607976aebeb57109ceafde7bba13eff9c43c /pkgs/development/tools/vagrant | |
parent | 0d75d67c3d16a7a2e31ddb6d25df942ba3f3b23e (diff) | |
download | nixlib-b66b0c58cae9e9f7e400f61de01c078b9466934d.tar nixlib-b66b0c58cae9e9f7e400f61de01c078b9466934d.tar.gz nixlib-b66b0c58cae9e9f7e400f61de01c078b9466934d.tar.bz2 nixlib-b66b0c58cae9e9f7e400f61de01c078b9466934d.tar.lz nixlib-b66b0c58cae9e9f7e400f61de01c078b9466934d.tar.xz nixlib-b66b0c58cae9e9f7e400f61de01c078b9466934d.tar.zst nixlib-b66b0c58cae9e9f7e400f61de01c078b9466934d.zip |
vagrant: Add vagrant-libvirt utility dependencies
When using vagrant-libvirt as provider, the 'vagrant package' command requires 'qemu-img' and 'virt-sysprep'.
Diffstat (limited to 'pkgs/development/tools/vagrant')
-rw-r--r-- | pkgs/development/tools/vagrant/default.nix | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pkgs/development/tools/vagrant/default.nix b/pkgs/development/tools/vagrant/default.nix index f2e6b00c09b3..b8ba30361aa8 100644 --- a/pkgs/development/tools/vagrant/default.nix +++ b/pkgs/development/tools/vagrant/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive, writeText, withLibvirt ? true}: +{ lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive, libguestfs, qemu, writeText, withLibvirt ? true}: let # NOTE: bumping the version and updating the hash is insufficient; @@ -48,10 +48,22 @@ in buildRubyGem rec { # PATH additions: # - libarchive: Make `bsdtar` available for extracting downloaded boxes - postInstall = '' + # withLibvirt only: + # - libguestfs: Make 'virt-sysprep' available for 'vagrant package' + # - qemu: Make 'qemu-img' available for 'vagrant package' + postInstall = + let + pathAdditions = lib.makeSearchPath "bin" + (map (x: "${lib.getBin x}") ([ + libarchive + ] ++ lib.optionals withLibvirt [ + libguestfs + qemu + ])); + in '' wrapProgram "$out/bin/vagrant" \ --set GEM_PATH "${deps}/lib/ruby/gems/${ruby.version.libDir}" \ - --prefix PATH ':' "${lib.getBin libarchive}/bin" + --prefix PATH ':' ${pathAdditions} mkdir -p "$out/vagrant-plugins/plugins.d" echo '{}' > "$out/vagrant-plugins/plugins.json" |