diff --git a/config-simple.hs b/config-simple.hs index e7ea473..bb01853 100644 --- a/config-simple.hs +++ b/config-simple.hs @@ -1,6 +1,7 @@ import Propellor import Propellor.CmdLine import qualified Propellor.Property.Apt as Apt +import qualified Propellor.Property.Cmd as Cmd import qualified Propellor.Property.Cron as Cron import qualified Propellor.Property.Docker as Docker @@ -9,20 +10,30 @@ main = defaultMain hosts hosts :: [Host] hosts = - [ host "hermit" - & os (System (Debian (Stable "jessie")) "amd64") - & Apt.stdSourcesList - & Apt.installed ["ssh", "build-essential"] - & Cron.runPropellor (Cron.Times "30 * * * *") - & Docker.configured - , host "empress" - & os (System (Debian (Stable "jessie")) "amd64") - & Apt.stdSourcesList - & Apt.installed ["ssh", "build-essential"] - & Cron.runPropellor (Cron.Times "30 * * * *") - & Docker.configured + [ baseHost "hermit" + , baseHost "empress" ] +nimInstall :: Cmd.Script +nimInstall = + [ "mkdir /tmp/niminstall -p" + , "cd /tmp/niminstall" + , "wget http://nim-lang.org/download/nim-0.11.2.tar.xz" + , "tar xf nim-0.11.2.tar.xz" + , "mv nim-0.11.2 /usr/local/nim" + , "cd /usr/local/nim" + , "./build.sh" + ] + +baseHost :: HostName -> Host +baseHost name = host name + & os (System (Debian (Stable "jessie")) "amd64") + & Apt.stdSourcesList + & Apt.installed ["ssh", "build-essential"] + & Cron.runPropellor (Cron.Times "30 * * * *") + & Docker.configured + & Cmd.scriptProperty nimInstall + standardStableContainer :: Docker.ContainerName -> Docker.Container standardStableContainer name = standardContainer name (Stable "jessie") "amd64"