nixpkgs/pkgs/development/tools/vagrant/default.nix

61 lines
1.3 KiB
Nix
Raw Normal View History

2018-04-27 11:50:46 +02:00
{ lib, buildRubyGem, bundlerEnv, ruby, libarchive }:
# To update vagrant, visit the Gemfile and re-run bundix.
2013-11-21 23:21:39 +01:00
2014-11-18 05:24:07 +01:00
let
2018-04-27 11:50:46 +02:00
gemset = import ./gemset.nix;
inherit (gemset.vagrant) version;
deps = bundlerEnv rec {
2018-04-27 11:50:46 +02:00
name = "vagrant-${version}";
pname = "vagrant";
inherit version;
inherit ruby;
gemdir = ./.;
};
2014-11-18 05:24:07 +01:00
in buildRubyGem rec {
name = "${gemName}-${version}";
gemName = "vagrant";
doInstallCheck = true;
dontBuild = false;
2018-04-27 11:50:46 +02:00
inherit (deps.gems.vagrant) src;
patches = [
./unofficial-installation-nowarn.patch
];
# PATH additions:
# - libarchive: Make `bsdtar` available for extracting downloaded boxes
postInstall = ''
wrapProgram "$out/bin/vagrant" \
--set GEM_PATH "${deps}/lib/ruby/gems/${ruby.version.libDir}" \
--prefix PATH ':' "${lib.getBin libarchive}/bin"
'';
2013-11-21 23:21:39 +01:00
installCheckPhase = ''
if [[ "$("$out/bin/vagrant" --version)" == "Vagrant ${version}" ]]; then
echo 'Vagrant smoke check passed'
else
echo 'Vagrant smoke check failed'
return 1
fi
'';
passthru = {
inherit ruby deps;
};
meta = with lib; {
2013-11-21 23:21:39 +01:00
description = "A tool for building complete development environments";
homepage = https://www.vagrantup.com/;
license = licenses.mit;
maintainers = with maintainers; [ aneeshusa ];
platforms = with platforms; linux ++ darwin;
2013-11-21 23:21:39 +01:00
};
}