2017-01-03 19:05:15 +01:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
|
2021-01-26 05:51:36 +01:00
|
|
|
config.vm.box = "ubuntu/focal64"
|
2017-01-03 19:05:15 +01:00
|
|
|
|
2018-01-25 05:02:43 +01:00
|
|
|
# use vagrant-disksize plugin to resize partition - https://github.com/sprotheroe/vagrant-disksize
|
|
|
|
config.disksize.size = '50GB'
|
2019-06-03 19:33:24 +02:00
|
|
|
|
2017-01-03 19:05:15 +01:00
|
|
|
config.vm.provider "virtualbox" do |vb|
|
|
|
|
# Customize the amount of memory on the VM
|
2019-06-03 19:33:24 +02:00
|
|
|
vb.memory = "4096"
|
2017-01-03 19:05:15 +01:00
|
|
|
end
|
|
|
|
|
2017-11-21 06:05:04 +01:00
|
|
|
# Share the root of the repo
|
2019-06-03 19:33:24 +02:00
|
|
|
config.vm.synced_folder "../", "/home/vagrant/termux-packages"
|
2017-11-21 06:05:04 +01:00
|
|
|
# Disable the default /vagrant share directory, as it shares the directory with the Vagrantfile in it, not the repo root
|
2017-01-03 19:05:15 +01:00
|
|
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
|
|
|
|
2019-06-03 19:33:24 +02:00
|
|
|
# Filesystem needs to be resized
|
|
|
|
config.vm.provision "shell", inline: "resize2fs /dev/sda1", privileged: true
|
2017-01-03 19:05:15 +01:00
|
|
|
|
2019-06-03 19:33:24 +02:00
|
|
|
# Run environment setup scripts
|
|
|
|
config.vm.provision "shell", inline: "cd /home/vagrant/termux-packages && ./scripts/setup-ubuntu.sh", privileged: false
|
|
|
|
config.vm.provision "shell", inline: "cd /home/vagrant/termux-packages && ./scripts/setup-android-sdk.sh", privileged: false
|
2017-01-03 19:05:15 +01:00
|
|
|
|
2018-01-25 05:02:43 +01:00
|
|
|
# Fix permissions on the /data directory in order to allow the "vagrant" user to write to it
|
2017-01-03 19:05:15 +01:00
|
|
|
config.vm.provision "shell",
|
2019-06-03 19:33:24 +02:00
|
|
|
inline: "chown -R vagrant /data", privileged: true
|
2017-01-03 19:05:15 +01:00
|
|
|
|
2017-11-21 06:05:04 +01:00
|
|
|
# Tell the user how to use the VM
|
2019-06-03 19:33:24 +02:00
|
|
|
config.vm.post_up_message = "Box has been provisioned! Use 'vagrant ssh' to enter the box. The repository root is available under '~/termux-packages'."
|
2017-01-03 19:05:15 +01:00
|
|
|
end
|