Skip to content

Commit

Permalink
vagrant: add vagrant-aws plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
risicle committed Nov 5, 2021
1 parent f622830 commit 1bec56c
Show file tree
Hide file tree
Showing 3 changed files with 851 additions and 4 deletions.
17 changes: 14 additions & 3 deletions pkgs/development/tools/vagrant/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{ stdenv, lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive
, libguestfs, qemu, writeText, withLibvirt ? stdenv.isLinux
, libguestfs, qemu, writeText, withLibvirt ? stdenv.isLinux, withAws ? false
}:

# dependencies of these two plugins conflict
assert !(withLibvirt && withAws);

let
# NOTE: bumping the version and updating the hash is insufficient;
# you must use bundix to generate a new gemset.nix in the Vagrant source.
Expand All @@ -25,7 +28,8 @@ let
};
inherit version;
};
} // lib.optionalAttrs withLibvirt (import ./gemset_libvirt.nix));
} // (lib.optionalAttrs withLibvirt (import ./gemset_libvirt.nix))
// (lib.optionalAttrs withAws (import ./gemset_aws.nix)));

# This replaces the gem symlinks with directories, resolving this
# error when running vagrant (I have no idea why):
Expand Down Expand Up @@ -88,7 +92,14 @@ in buildRubyGem rec {
cp -av contrib/bash/completion.sh $out/share/bash-completion/completions/vagrant
'' +
lib.optionalString withLibvirt ''
substitute ${./vagrant-libvirt.json.in} $out/vagrant-plugins/plugins.d/vagrant-libvirt.json \
substitute ${./vagrant-plugin.json.in} $out/vagrant-plugins/plugins.d/vagrant-libvirt.json \
--subst-var-by pname libvirt \
--subst-var-by ruby_version ${ruby.version} \
--subst-var-by vagrant_version ${version}
'' +
lib.optionalString withAws ''
substitute ${./vagrant-plugin.json.in} $out/vagrant-plugins/plugins.d/vagrant-aws.json \
--subst-var-by pname aws \
--subst-var-by ruby_version ${ruby.version} \
--subst-var-by vagrant_version ${version}
'';
Expand Down
Loading

0 comments on commit 1bec56c

Please sign in to comment.