Created
February 24, 2014 13:20
-
-
Save glutamate/9188304 to your computer and use it in GitHub Desktop.
Vagrantfile for minimal haskell development environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $script = <<SCRIPT | |
| sed -i -e 's/us.archive.ubuntu.com/gb.archive.ubuntu.com/g' /etc/apt/sources.list | |
| apt-get update | |
| apt-get install -y build-essential libedit2 libgmp3-dev libgmp3c2 zlib1g-dev wget zile git | |
| if [ ! `which ghc` ]; then | |
| # Download and extract GHC and the Haskell Platform | |
| echo 'Fetching ghc binary tarball...' | |
| wget -q http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-linux.tar.bz2 | |
| tar xjf ghc-7.6.3-x86_64-unknown-linux.tar.bz2 | |
| rm ghc-7.6.3-x86_64-unknown-linux.tar.bz2 | |
| # Build and install GHC | |
| cd ghc-7.6.3; ./configure && make install | |
| cd .. | |
| rm -rf ghc-7.6.3 | |
| fi | |
| if [ ! `which cabal` ]; then | |
| mkdir -p /home/vagrant/.cabal/bin | |
| chown -R vagrant /home/vagrant/.cabal | |
| echo "PATH=\"/home/vagrant/.cabal/bin:$PATH\"" >> /etc/environment | |
| export PREFIX="/home/vagrant/.cabal" | |
| export PATH="$PREFIX/bin:$PATH" | |
| echo $PATH | |
| echo $PREFIX | |
| echo 'Fetching cabal-install tarball...' | |
| cd /home/vagrant | |
| wget -q http://hackage.haskell.org/package/cabal-install-1.18.0.2/cabal-install-1.18.0.2.tar.gz | |
| tar xzf cabal-install-1.18.0.2.tar.gz | |
| rm cabal-install-1.18.0.2.tar.gz | |
| # Build and install the Haskell Platform | |
| cd cabal-install-1.18.0.2; | |
| chown -R vagrant . | |
| su vagrant './bootstrap.sh' | |
| cd /home/vagrant | |
| rm -rf cabal-install-1.18.0.2 | |
| su vagrant -c 'cabal update' | |
| fi | |
| if [ ! `which happy` ]; then | |
| su vagrant -c 'cabal install happy' | |
| fi | |
| SCRIPT | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "precise64" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
| config.vm.network :forwarded_port, guest: 3000, host: 3000 | |
| # edit the synced folder mappings | |
| config.vm.synced_folder ".", "/home/vagrant/therapy-server" | |
| config.vm.provider :virtualbox do |vb| | |
| vb.gui = false | |
| vb.customize ["modifyvm", :id, "--memory", "2048"] | |
| vb.customize ["modifyvm", :id, "--cpus", "2"] | |
| end | |
| config.vm.provision "shell", inline: $script | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download pipe broken.
Failed to connect to hashicorp-files.hashicorp.com port 443: Connection timed out
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Failed to connect to hashicorp-files.hashicorp.com port 443: Connection timed out