From db2ea06826466ed06349bc813bada8c01cc8d076 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 19 Jul 2015 18:20:07 -0700 Subject: [PATCH] add f21 dotfiles --- dev/fedora/21/base/Dockerfile | 39 +++++++++++++++++++++++-- dev/fedora/21/base/setup.sh | 48 +++++++++++++++++++++++++++++++ dev/fedora/21/base/vimplugins.lua | 12 ++++++++ 3 files changed, 97 insertions(+), 2 deletions(-) create mode 100755 dev/fedora/21/base/setup.sh create mode 100644 dev/fedora/21/base/vimplugins.lua diff --git a/dev/fedora/21/base/Dockerfile b/dev/fedora/21/base/Dockerfile index c2e8b49..7c71524 100644 --- a/dev/fedora/21/base/Dockerfile +++ b/dev/fedora/21/base/Dockerfile @@ -1,4 +1,39 @@ FROM fedora:21 -RUN yum -y groupinstall "Development Tools" -RUN yum -y install tar +RUN dnf -y groupinstall "Development Tools" &&\ + dnf -y install tar zsh git python wget openssl-devel vim-enhanced tmux dtach cmake python-devel mercurial lua luarocks gcc-c++ xz clang-devel &&\ + useradd --create-home xena && \ + echo 'root:screencast' | chpasswd && \ + echo 'xena:user' | chpasswd && \ + chsh xena -s /bin/zsh + +# Envvars! +ENV HOME /home/xena +ENV DOCKER YES +ENV LANGUAGE en_US +ENV LC_ALL en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LC_CTYPE en_US.UTF-8 + +# To use Docker please pass the docker socket as a bind mount +# Some of my servers still use docker 1.3.0 +RUN wget https://get.docker.com/builds/Linux/x86_64/docker-1.3.0 -O /usr/local/bin/docker && \ + chmod 555 /usr/local/bin/docker + +# Golang compilers +RUN cd /usr/local && wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz && \ + tar xf go1.4.2.linux-amd64.tar.gz && rm go1.4.2.linux-amd64.tar.gz + +ADD setup.sh /opt/xena/setup.sh +ADD ./vimplugins.lua /opt/xena/vimplugins.lua +RUN chmod 777 /opt/xena/setup.sh &&\ + su xena "/opt/xena/setup.sh" + +RUN dnf -y install dnf-plugins-core &&\ + yes | dnf copr enable xena/moonscript &&\ + dnf -y install lua-moonscript &&\ + yes | dnf copr enable avsej/nim &&\ + dnf -y install nim + +USER xena +CMD /bin/zsh diff --git a/dev/fedora/21/base/setup.sh b/dev/fedora/21/base/setup.sh new file mode 100755 index 0000000..6c7bea8 --- /dev/null +++ b/dev/fedora/21/base/setup.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -x + +# Sanity check / setup +cd /home/xena +mkdir code ||: + +# Clone dotiles +git clone https://github.com/Xe/dotfiles code/dotfiles ||: + +# setlink sets a symlink to my dotfiles repo for the correct file. +function setlink +{ + rm -rf $HOME/$1 + ln -s $HOME/code/dotfiles/$1 $HOME/$1 +} + +# set links +setlink .zshrc +setlink .zsh +setlink .vim +setlink .vimrc +setlink .gitconfig +setlink .tmux.conf + +export GOPATH=/home/xena/go +export PATH=/usr/local/go/bin:$PATH + +# Golang stuff +(mkdir -p ~/go/{pkg,bin,src}) +go get github.com/mattn/todo +go get github.com/motemen/ghq +go get github.com/Xe/tools/license + +# Setup vundle +git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + +# Set up vim plugins +cat ~/.vimrc | grep Plugin | cut -d"'" -f2 > ~/.plugins +(cd ~/.vim/bundle && lua /opt/xena/vimplugins.lua ~/.plugins) + +# Binary extensions for vim +(cd ~/.vim/bundle/YouCompleteMe; ./install.sh --clang-completer) +(cd ~/.vim/bundle/vimproc.vim; make) +vim -T dumb +GoInstallBinaries +qall + +echo "Set up!" diff --git a/dev/fedora/21/base/vimplugins.lua b/dev/fedora/21/base/vimplugins.lua new file mode 100644 index 0000000..ca8098b --- /dev/null +++ b/dev/fedora/21/base/vimplugins.lua @@ -0,0 +1,12 @@ +fin = io.open(arg[1], "r") + +if fin == nil then + error("Can't open " .. arg[1]) +end + +for line in fin:lines() do + os.execute("git clone https://github.com/" .. line) + os.execute("cd " .. line:match(".+/(.+)") .. " && git submodule update --init --recursive && cd ..") +end + +fin:close()