From 6227df8e016f97fe80084a119e67d150686dbbc5 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Tue, 3 Mar 2020 14:23:13 -0500 Subject: [PATCH] vagrant setup --- .gitignore | 3 +++ Vagrantfile | 10 ++++++++++ vagrant/as_user.sh | 8 ++++++++ vagrant/provision.sh | 10 ++++++++++ 4 files changed, 31 insertions(+) create mode 100644 Vagrantfile create mode 100755 vagrant/as_user.sh create mode 100755 vagrant/provision.sh diff --git a/.gitignore b/.gitignore index fbf94dc..003a0da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .stack-work/ mtlstats.cabal +.vagrant +data +*.log *~ \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..1f739c9 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,10 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/xenial64" + config.vm.provision "shell", path: "vagrant/provision.sh" + config.vm.provider :virtualbox do |v| + v.customize ["modifyvm", :id, "--memory", 4096] + end +end diff --git a/vagrant/as_user.sh b/vagrant/as_user.sh new file mode 100755 index 0000000..ab1b3c8 --- /dev/null +++ b/vagrant/as_user.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +echo "export PATH=\"$HOME/.local/bin:$PATH\"" >>~vagrant/.bashrc +mkdir /vagrant/data +ln -s /vagrant/data ~vagrant/.mtlstats + +cd /vagrant +stack install diff --git a/vagrant/provision.sh b/vagrant/provision.sh new file mode 100755 index 0000000..bb2fffd --- /dev/null +++ b/vagrant/provision.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +apt-get update +apt-get upgrade +apt-get -y install libghc-ncurses-dev +wget -qO- https://get.haskellstack.org/ | sh + +export HOME=/home/vagrant + +sudo -u vagrant /vagrant/vagrant/as_user.sh