incorporate pyenv, nvm, profile scripts, autolink ~/dev
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
19a607971c
commit
7bc4fbffc5
@ -36,6 +36,7 @@ pip3 install black
|
||||
|
||||
echo chown -Rv $UID_TO_ADD:$GID_TO_ADD /home/user
|
||||
chown -Rv $UID_TO_ADD:$GID_TO_ADD /home/user
|
||||
chsh --shell $(which zsh) $USERNAME_TO_ADD
|
||||
|
||||
sudo \
|
||||
--set-home \
|
||||
|
@ -19,13 +19,21 @@ export ZSH="$HOME/.zsh"
|
||||
bash /tmp/installomz.sh --unattended --keep-zshrc
|
||||
|
||||
# vim-plug
|
||||
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
# this should happen from vimrc
|
||||
#curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
||||
# https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
|
||||
# link in ssh key from original home
|
||||
mkdir -p ~/.ssh
|
||||
ln -s ~/.home/.ssh/id_rsa ~/.ssh/id_rsa
|
||||
ln -s ~/.home/.ssh/id_rsa.pub ~/.ssh/id_rsa.pub
|
||||
|
||||
# install pyenv
|
||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
||||
# FIXME install a python version
|
||||
|
||||
git clone https://github.com/nvm-sh/nvm.git ~/.nvm
|
||||
# FIXME install an nvm version
|
||||
|
||||
# move this to runtime FIXME
|
||||
#DEVDIR="$( cd ~/.home/dev >/dev/null 2>&1 && pwd -P)"
|
||||
|
@ -8,6 +8,14 @@ if [[ -e "$HD/.setupdone" ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
sudo -l -u $UN /bin/bash << EOF
|
||||
echo "user setup done" > ~/.setupdone
|
||||
EOF
|
||||
sudo \
|
||||
--set-home \
|
||||
--non-interactive \
|
||||
-u $UN \
|
||||
bash ./usersetup.sh && \
|
||||
sudo \
|
||||
--set-home \
|
||||
--non-interactive \
|
||||
-u $UN \
|
||||
touch $HD/.setupdone
|
||||
|
||||
|
7
root/etc/service/runtime-setup-user/usersetup.sh
Normal file
7
root/etc/service/runtime-setup-user/usersetup.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -e ~/.home/Documents/scratch/dev ]]; then
|
||||
ln -s ~/.home/Documents/scratch/dev ~/dev
|
||||
else
|
||||
ln -s ~/.home/dev ~/dev
|
||||
fi
|
3
root/home/user/.local/profile.d/100.aliases.sh
Normal file
3
root/home/user/.local/profile.d/100.aliases.sh
Normal file
@ -0,0 +1,3 @@
|
||||
alias unsafessh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||
alias prettier="prettier --tab-width 4"
|
||||
alias gencapkey="ssh-keygen -m PEM -t rsa -b 2048 -C \"caprover\" -f ./key -q -N \"\""
|
2
root/home/user/.local/profile.d/100.editor.sh
Normal file
2
root/home/user/.local/profile.d/100.editor.sh
Normal file
@ -0,0 +1,2 @@
|
||||
export EDITOR=vim
|
||||
|
10
root/home/user/.local/profile.d/100.gopath.sh
Normal file
10
root/home/user/.local/profile.d/100.gopath.sh
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
export GOPATH="$HOME/dev/go"
|
||||
|
||||
if [[ -d /usr/local/go/bin ]]; then
|
||||
export PATH="$PATH:/usr/local/go/bin"
|
||||
fi
|
||||
|
||||
if [[ -d "$GOPATH/bin" ]]; then
|
||||
export PATH="$PATH:$GOPATH/bin"
|
||||
fi
|
7
root/home/user/.local/profile.d/100.path.sh
Normal file
7
root/home/user/.local/profile.d/100.path.sh
Normal file
@ -0,0 +1,7 @@
|
||||
if [[ -d "$HOME/.local/bin" ]]; then
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
fi
|
||||
|
||||
if [[ -d "$HOME/bin" ]]; then
|
||||
export PATH="$PATH:$HOME/bin"
|
||||
fi
|
10
root/home/user/.local/profile.d/100.spyware.sh
Executable file
10
root/home/user/.local/profile.d/100.spyware.sh
Executable file
@ -0,0 +1,10 @@
|
||||
export HOMEBREW_NO_ANALYTICS=1
|
||||
export GATSBY_TELEMETRY_DISABLED=1
|
||||
export STNOUPGRADE=1
|
||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
export SAM_CLI_TELEMETRY=0
|
||||
export AZURE_CORE_COLLECT_TELEMETRY=0
|
||||
export DO_NOT_TRACK=1
|
||||
if command -v gcloud >/dev/null 2>&1 >/dev/null ; then
|
||||
gcloud config set disable_usage_reporting true >/dev/null 2>&1
|
||||
fi
|
1
root/home/user/.local/profile.d/200.gitconfig.sh
Normal file
1
root/home/user/.local/profile.d/200.gitconfig.sh
Normal file
@ -0,0 +1 @@
|
||||
git config --global push.default matching
|
6
root/home/user/.local/profile.d/200.pyenv.sh
Normal file
6
root/home/user/.local/profile.d/200.pyenv.sh
Normal file
@ -0,0 +1,6 @@
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
|
||||
if which pyenv 2>&1 > /dev/null ; then
|
||||
eval "$(pyenv init -)"
|
||||
fi
|
5
root/home/user/.local/profile.d/300.nvm.sh
Normal file
5
root/home/user/.local/profile.d/300.nvm.sh
Normal file
@ -0,0 +1,5 @@
|
||||
export NVM_DIR="~/.nvm"
|
||||
|
||||
if [[ -e "$NVM_DIR/nvm.sh" ]]; then
|
||||
source "$NVM_DIR/nvm.sh"
|
||||
fi
|
19
root/home/user/.local/profile.d/999.bash-history.sh
Normal file
19
root/home/user/.local/profile.d/999.bash-history.sh
Normal file
@ -0,0 +1,19 @@
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
|
||||
HISTSIZE=10000
|
||||
# Save 2,000,000 lines of history to disk (will have to grep ~/.bash_history for full listing)
|
||||
HISTFILESIZE=2000000
|
||||
# Append to history instead of overwrite
|
||||
shopt -s histappend
|
||||
# Ignore redundant or space commands
|
||||
HISTCONTROL=ignoreboth
|
||||
# Ignore more
|
||||
HISTIGNORE='ls:ll:ls -alh:pwd:clear:history'
|
||||
# Set time format
|
||||
HISTTIMEFORMAT='%F %T '
|
||||
# Multiple commands on one line show up as a single line
|
||||
shopt -s cmdhist
|
||||
# Append new history lines, clear the history list, re-read the history list, print prompt.
|
||||
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
|
||||
|
||||
fi
|
8
root/home/user/.local/profile.d/999.kubectl.sh
Normal file
8
root/home/user/.local/profile.d/999.kubectl.sh
Normal file
@ -0,0 +1,8 @@
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
if which kubectl 2>&1 > /dev/null ; then
|
||||
source <(kubectl completion bash)
|
||||
fi
|
||||
|
||||
alias k=kubectl
|
||||
complete -F __start_kubectl k
|
||||
fi
|
9
root/home/user/.local/profile.d/999.zsh-git-prompt.sh
Normal file
9
root/home/user/.local/profile.d/999.zsh-git-prompt.sh
Normal file
@ -0,0 +1,9 @@
|
||||
ZGP="$HOME/Library/Homebrew/opt/zsh-git-prompt/zshrc.sh"
|
||||
if [ -n "$ZSH_VERSION" ]; then
|
||||
if [[ -e "$ZGP" ]]; then
|
||||
source "$ZGP"
|
||||
fi
|
||||
export PROMPT='%m:%~ $(git_super_status)$ '
|
||||
fi
|
||||
|
||||
|
94
root/home/user/.zshrc
Normal file
94
root/home/user/.zshrc
Normal file
@ -0,0 +1,94 @@
|
||||
# If you come from bash you might have to change your $PATH.
|
||||
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
||||
|
||||
# Path to your oh-my-zsh installation.
|
||||
export ZSH="/home/user/.zsh"
|
||||
|
||||
# Set name of the theme to load --- if set to "random", it will
|
||||
# load a random theme each time oh-my-zsh is loaded, in which case,
|
||||
# to know which specific one was loaded, run: echo $RANDOM_THEME
|
||||
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
|
||||
ZSH_THEME="robbyrussell"
|
||||
|
||||
# Set list of themes to pick from when loading at random
|
||||
# Setting this variable when ZSH_THEME=random will cause zsh to load
|
||||
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
|
||||
# If set to an empty array, this variable will have no effect.
|
||||
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
|
||||
|
||||
# Uncomment the following line to use case-sensitive completion.
|
||||
# CASE_SENSITIVE="true"
|
||||
|
||||
# Uncomment the following line to use hyphen-insensitive completion.
|
||||
# Case-sensitive completion must be off. _ and - will be interchangeable.
|
||||
# HYPHEN_INSENSITIVE="true"
|
||||
|
||||
# Uncomment the following line to disable bi-weekly auto-update checks.
|
||||
# DISABLE_AUTO_UPDATE="true"
|
||||
|
||||
# Uncomment the following line to automatically update without prompting.
|
||||
# DISABLE_UPDATE_PROMPT="true"
|
||||
|
||||
# Uncomment the following line to change how often to auto-update (in days).
|
||||
# export UPDATE_ZSH_DAYS=13
|
||||
|
||||
# Uncomment the following line if pasting URLs and other text is messed up.
|
||||
# DISABLE_MAGIC_FUNCTIONS=true
|
||||
|
||||
# Uncomment the following line to disable colors in ls.
|
||||
# DISABLE_LS_COLORS="true"
|
||||
|
||||
# Uncomment the following line to disable auto-setting terminal title.
|
||||
# DISABLE_AUTO_TITLE="true"
|
||||
|
||||
# Uncomment the following line to enable command auto-correction.
|
||||
# ENABLE_CORRECTION="true"
|
||||
|
||||
# Uncomment the following line to display red dots whilst waiting for completion.
|
||||
# COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Uncomment the following line if you want to disable marking untracked files
|
||||
# under VCS as dirty. This makes repository status check for large repositories
|
||||
# much, much faster.
|
||||
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||
|
||||
# Uncomment the following line if you want to change the command execution time
|
||||
# stamp shown in the history command output.
|
||||
# You can set one of the optional three formats:
|
||||
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
||||
# or set a custom format using the strftime function format specifications,
|
||||
# see 'man strftime' for details.
|
||||
# HIST_STAMPS="mm/dd/yyyy"
|
||||
|
||||
# Would you like to use another custom folder than $ZSH/custom?
|
||||
# ZSH_CUSTOM=/path/to/new-custom-folder
|
||||
|
||||
# Which plugins would you like to load?
|
||||
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
|
||||
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
# Add wisely, as too many plugins slow down shell startup.
|
||||
plugins=(git)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
# User configuration
|
||||
|
||||
export LANG=en_US.UTF-8
|
||||
export EDITOR=vim
|
||||
|
||||
for FN in ~/.local/profile.d/*.sh ; do
|
||||
source "$FN"
|
||||
done
|
||||
|
||||
# Compilation flags
|
||||
# export ARCHFLAGS="-arch x86_64"
|
||||
|
||||
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
||||
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
||||
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
|
||||
# For a full list of active aliases, run `alias`.
|
||||
#
|
||||
# Example aliases
|
||||
# alias zshconfig="mate ~/.zshrc"
|
||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
Loading…
Reference in New Issue
Block a user