Permalink
Browse files

Use puppet for setting up the box

Added a few helper files, fix emacs setup.
Update README so that it mentions the sbcl-ql-setup.sh issue. For some reason I can't get it to work properly from puppet.
  • Loading branch information...
1 parent ff6e049 commit 83f877346a0ea27d20738957bae29a5868203bf4 @finitud committed Nov 24, 2012
View
@@ -23,7 +23,10 @@ just throw the files into your project's main directory (less clean).
Issues
======
-* Need to add slime loading to .emacs after installing Quicklisp
-* Fix Quicklisp installation -> needs a bash script running on ~vagrant directory
+* The Quicklisp configuration script doesn't work properly. To finish the VM setup, run
+
+ ./sbcl-ql-setup.sh
+
+the first time you log into the VM.
View
@@ -5,11 +5,13 @@ Vagrant::Config.run do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.forward_port 80, 8000
-# config.vm.provision :shell, :path => "common_lisp.sh"
- config.vm.provision :puppet, :module_path => "private/puppet/modules" do |puppet|
+ config.vm.provision :puppet, :options => ["--debug", "--verbose"] do |puppet|
puppet.manifests_path = "private/puppet/manifests"
+ puppet.module_path = "private/puppet/modules"
puppet.manifest_file = "base.pp"
end
+# config.vm.provision :shell, :path => "common_lisp.sh"
+
end
View
@@ -1,33 +0,0 @@
-#! /bin/bash
-
-# # Only let the user 'vagrant' run the script
-# # We don't want to break anything outside the vagrant box
-# if [ $USER != 'vagrant' ]; then
-# echo "This script is to be run in vagrant"
-# exit 1
-# fi
-
-# Get apt up to date and install some basic stuff
-sudo apt-get update
-sudo apt-get install -y python-software-properties curl
-sudo add-apt-repository ppa:cassou/emacs -y
-sudo apt-get update
-
-# Install the development environment
-sudo apt-get install -y emacs24 emacs24-el emacs24-common-non-dfsg
-sudo apt-get install -y git-core
-sudo apt-get install -y sbcl sbcl-doc sbcl-source
-
-# Install and configure Quicklisp
-curl -O http://beta.quicklisp.org/quicklisp.lisp
-sbcl --load quicklisp.lisp <<EOF
-(quicklisp-quickstart:install)
-(ql:add-to-init-file)
-(ql:quickload "quicklisp-slime-helper")
-
-EOF
-
-# Configure dot-emacs file to load Quicklisp slime helper
-echo "(load (expand-file-name \"~/quicklisp/slime-helper.el\"))" >> ~vagrant/.emacs
-echo "(setq inferior-lisp-program \"/usr/bin/sbcl\")" >> ~vagrant/.emacs
-
@@ -17,36 +17,59 @@
require => Exec['add emacs repository'],
}
-package { ['emacs24', 'emacs24-el', 'emacs24-common-non-dfsg']:
+package { ['emacs24', 'emacs24-el', 'emacs24-common-non-dfsg',
+ 'git-core',
+ 'sbcl', 'sbcl-doc', 'sbcl-source',
+ ]:
ensure => present,
require => Exec['second update'],
}
-package { 'git-core':
- ensure => present,
- require => Exec['second update'],
+
+exec { 'download quicklisp':
+ command => '/usr/bin/curl http://beta.quicklisp.org/quicklisp.lisp -o /home/vagrant/quicklisp.lisp',
+ require => Package['curl'],
}
-package { ['sbcl', 'sbcl-doc', 'sbcl-source']:
+file { 'sbcl-ql-install.lisp':
+ path => '/home/vagrant/sbcl-ql-install.lisp',
ensure => present,
- require => Exec['second update'],
+ source => 'puppet:///modules/quicklisp/sbcl-ql-install.lisp',
}
+file { 'emacs-dir':
+ path => '/home/vagrant/.emacs.d',
+ ensure => 'directory',
+ owner => 'vagrant',
+ mode => '755',
+}
-exec { 'download quicklisp':
- command => '/usr/bin/curl http://beta.quicklisp.org/quicklisp.lisp -o /tmp/quicklisp.lisp',
- require => Package['curl'],
+file { 'dot-emacs':
+ path => '/home/vagrant/.emacs',
+ ensure => present,
+ source => 'puppet:///modules/quicklisp/dot-emacs',
}
-file { 'sbcl-ql-install.lisp':
- path => '/tmp/sbcl-ql-install.lisp',
+file { 'load-slime.el':
+ path => '/home/vagrant/.emacs.d/load-slime.el',
ensure => present,
- source => 'puppet:///modules/quicklisp/sbcl-ql-install.lisp',
+ source => 'puppet:///modules/quicklisp/load-slime.el',
+ require => File['emacs-dir'],
}
-exec { 'install quicklisp':
- command => '/usr/bin/sbcl --load /tmp/sbcl-ql-install.lisp',
- require => [ File['sbcl-ql-install.lisp'],
- Package['sbcl'],
- Exec['download quicklisp'] ],
+file { 'sbcl-ql-setup.sh' :
+ path => '/home/vagrant/sbcl-ql-setup.sh',
+ ensure => present,
+ owner => 'vagrant',
+ mode => '750',
+ source => 'puppet:///modules/quicklisp/sbcl-ql-setup.sh',
}
+
+# exec { 'install quicklisp':
+# command => '/usr/bin/sudo -u vagrant sh -c "cd /home/vagrant; ./sbcl-ql-setup.sh"',
+# require => [ File['sbcl-ql-install.lisp'],
+# File['sbcl-ql-setup.sh'],
+# File['emacs-dir'],
+# Package['sbcl'],
+# Exec['download quicklisp'], ],
+# }
@@ -0,0 +1,9 @@
+;; Load all load-*.el files in the .emacs.d directory
+
+(mapcar 'load-file
+ (file-expand-wildcards "~/.emacs.d/load-*.el" t))
+
+;; Continue loading the standard init.el file...
+
+(if (file-exists-p "~/.emacs.d/init.el")
+ (load-file "~/.emacs.d/init.el"))
@@ -0,0 +1,2 @@
+(load (expand-file-name "~/quicklisp/slime-helper.el"))
+(setq inferior-lisp-program "/usr/bin/sbcl")
@@ -1,5 +1,6 @@
-(load "/tmp/quicklisp.lisp")
+(load "quicklisp.lisp")
+(quicklisp-quickstart:install); :path #P"/home/vagrant/quicklisp")
(ql-util:without-prompting
- (quicklisp-quickstart:install)
(ql:add-to-init-file)
(ql:quickload "quicklisp-slime-helper"))
+(sb-ext:quit)
@@ -0,0 +1,4 @@
+#! /bin/bash
+
+cd ~vagrant
+/usr/bin/sbcl --load sbcl-ql-install.lisp

0 comments on commit 83f8773

Please sign in to comment.