From 261973544f55d8a9e138ac13e70495c8169a018c Mon Sep 17 00:00:00 2001 From: Aaron Addleman Date: Mon, 11 Mar 2019 19:57:43 +0000 Subject: [PATCH] Add spacemacs file that I enjoy - If applied, this commit will... Add a .spacemacs file. Perhaps in the future this should be optional. - Explain why this change is being made... This is my IDE. I need defaults! - Provide links to any relevant tickets, articles, or other resources... --- Dockerfile | 1 + README.md | 18 ++++++++++++------ scripts/ops.sh | 13 +++++++++++-- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 39b66e8..744a8f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -108,6 +108,7 @@ RUN node /opt/conda/lib/python3.6/site-packages/jupyterlab/staging/yarn.js insta RUN jupyter labextension install @yunabe/lgo_extension RUN jupyter labextension install @pyviz/jupyterlab_pyviz ADD .zshrc $HOME/.zshrc +ADD .spacemacs-good $HOME/.spacemacs # install aws RUN pip install awscli --upgrade --user diff --git a/README.md b/README.md index 2a984d7..59cd6cd 100644 --- a/README.md +++ b/README.md @@ -35,16 +35,22 @@ docker run \ -v "$HOME/src:/home/jovyan/src" \ aaronaddleman/jupyterlabs:latest # -# or if you want to mount everything (and you might...not want to type the secret everytime...) -# +# +# or set your home dir to something you like +# +NB_USER=$1 +IMAGE=$2 +PORT=${3:=8888} + docker run \ --p 8888:8888 \ +--user root \ +-p $PORT:8888 \ +-e NB_USER=$NB_USER \ +-e SHELL=/usr/bin/zsh \ -e JUPYTER_ENABLE_LAB=yes \ -e USE_SSL=yes \ -e GEN_CERT=yes \ --v "$HOME/src:/home/jovyan/src" \ --v "$PWD/jupyter_work:/home/jovyan/work" \ --v "$PWD/jupyter_local:/home/jovyan/.local" \ +-e GRANT_SUDO=yes aaronaddleman/jupyterlabs:latest ``` diff --git a/scripts/ops.sh b/scripts/ops.sh index 230e56b..d59ae48 100644 --- a/scripts/ops.sh +++ b/scripts/ops.sh @@ -101,8 +101,13 @@ git config --global credential.helper cache export EDITOR=vi # set permissions for .emacs.d and .spacemacs -sudo chown -R "$USER":users $HOME/.emacs.d -sudo chown -R "$USER":users $HOME/.spacemacs +if [ -d $HOME/.emacs.d ]; then + sudo chown -R "$USER":users $HOME/.emacs.d +fi + +if [ -f $HOME/.spacemacs ]; then + sudo chown -R "$USER":users $HOME/.spacemacs +fi # set things for vault export VAULT_LOGIN_METHOD=ldap @@ -123,3 +128,7 @@ if [ -f /data/resources/git/commit-message.txt ]; then git config --global commit.template /data/resources/git/commit-message.txt fi +# install spacemacs if missing +if [ ! -d ~/.emacs.d ]; then + git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d +fi