# -*- mode: ruby -*- # vi: set ft=ruby : project_name = "grapple" Vagrant.configure(2) do |config| config.vm.box = "bento/ubuntu-16.04" config.vm.provision :shell, inline: setup_deps config.vm.provision :shell, inline: setup_rust config.vm.provision :shell, inline: set_prompt("#{project_name.upcase}-BOX") config.vm.synced_folder "..", "/#{project_name}" config.vm.provider "virtualbox" do |vb| vb.memory = "1024" end end def setup_deps <<-SCRIPT curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y build-essential nodejs yarn pkg-config SCRIPT end def setup_rust 'curl https://sh.rustup.rs -sSf | sudo -u vagrant HOME=/home/vagrant sh -s -- --default-toolchain nightly -y 2>&1' end def set_prompt(box_name) %Q(echo "PS1='\\[\\033[0;32m\\]#{box_name}"'$(q=$?; [[ $q -gt 0 ]] && echo " \\[\\033[0;31m\\]$q")'" \\[\\033[0;37m\\]\\w\\[\\033[0m\\]$ '" >> /home/vagrant/.bashrc) end