Skip to content

Commit

Permalink
improve docker build, refactor zshrc
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfluegge committed Jun 5, 2024
1 parent e9bcfe3 commit 67c5181
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 34 deletions.
43 changes: 14 additions & 29 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# aliases
alias vz="nvim ~/.zshrc"
alias sz="source ~/.zshrc"
alias nv="nvim"
# alias rr="pipx run --spec ranger-fm ranger"
alias rr="ranger"
alias rrzsh="f(){ rr --selectfile=$HOME/.zsh/.git };f"
alias rrconfig="f(){ rr --selectfile=$HOME/.config/ranger };f"
alias fb=$HOME/.scripts/fzfbookmarks.sh
alias ls="eza --icons=always"
alias ta="tmux attach -t"
alias tl='tmux list-sessions'
alias tn="tmux new -s $(pwd | sed 's/.*\///g')"

export ZSH="$HOME/.zsh"
export ZSH_CUSTOM="$ZSH/custom"
Expand Down Expand Up @@ -88,22 +75,6 @@ export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
# Enable zoxide shell
eval "$(zoxide init zsh)"

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$("$HOME/.pyenv/versions/miniconda3-3.11-23.5.2-0/bin/conda" "shell.zsh" "hook" 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$HOME/.pyenv/versions/miniconda3-3.11-23.5.2-0/etc/profile.d/conda.sh" ]; then
. "$HOME/.pyenv/versions/miniconda3-3.11-23.5.2-0/etc/profile.d/conda.sh"
else
export PATH="$HOME/.pyenv/versions/miniconda3-3.11-23.5.2-0/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<


# only show last dir in prompt
# function zsh_directory_name() {
# emulate -L zsh
Expand All @@ -118,4 +89,18 @@ unset __conda_setup
# return 1
# }

# aliases
alias vz="nvim ~/.zshrc"
alias sz="source ~/.zshrc"
alias nv="nvim"
# alias rr="pipx run --spec ranger-fm ranger"
alias rr="ranger"
alias rrzsh="f(){ rr --selectfile=$HOME/.zsh/.git };f"
alias rrconfig="f(){ rr --selectfile=$HOME/.config/ranger };f"
alias fb=$HOME/.scripts/fzfbookmarks.sh
alias ls="eza --icons=always"
alias ta="tmux attach -t"
alias tl='tmux list-sessions'
alias tn='tmux new-session -s $(basename "$PWD")'

[ -f $HOME/.zcustomaliases ] && source $HOME/.zcustomaliases
22 changes: 17 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ RUN apt-get update && apt-get install -y \

RUN apt-get update && apt-get install -y \
tmux \
fzf \
neovim \
zsh \
jq \
Expand All @@ -43,8 +42,6 @@ RUN apt-get update && apt-get install -y \
tk-dev \
libffi-dev \
liblzma-dev \
python3-openssl \
python3-pip \
pipx

RUN apt-get update && apt-get install -y \
Expand All @@ -62,6 +59,9 @@ ENV LANGUAGE en_US.UTF-8
RUN chsh -s $(which zsh)
SHELL ["/bin/zsh", "-c"]

# ------------------- Install fzf ------------------- #
RUN git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.fzf && $HOME/.fzf/install

# ------------------- Install Docker ------------------- #
# Add Docker’s official GPG key and set up the stable repository
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
Expand Down Expand Up @@ -95,7 +95,7 @@ COPY .scripts $HOME/.scripts
COPY .zshrc $HOME/.zshrc
COPY .zprofile $HOME/.zprofile

RUN +chmod +x $HOME/.scripts/*
RUN chmod +x $HOME/.scripts/*

# ------------------- Install pyenv ------------------- #
RUN curl https://pyenv.run | zsh
Expand Down Expand Up @@ -160,7 +160,7 @@ RUN /bin/zsh -c "source /opt/conda/bin/activate && conda update -n base -c conda
RUN source $HOME/.zprofile && nvm install $NODE_VERSION && nvm use $NODE_VERSION

# Ensure pip is installed and upgrade it
RUN pip3 install --upgrade pip --break-system-packages
RUN source $HOME/.zprofile && pip3 install --upgrade pip --break-system-packages

# Ensure pipx is installed
RUN pipx ensurepath
Expand Down Expand Up @@ -198,6 +198,18 @@ RUN source $HOME/.cargo/env \
&& cp target/release/delta /usr/local/bin/ \
&& rm -rf /tmp/delta

RUN touch $HOME/.gitconfig && \
echo '[core]' >> $HOME/.gitconfig && \
echo ' pager = delta' >> $HOME/.gitconfig && \
echo '[interactive]' >> $HOME/.gitconfig && \
echo ' diffFilter = delta --color-only' >> $HOME/.gitconfig && \
echo '[delta]' >> $HOME/.gitconfig && \
echo ' navigate = true' >> $HOME/.gitconfig && \
echo '[merge]' >> $HOME/.gitconfig && \
echo ' conflictStyle = diff3' >> $HOME/.gitconfig && \
echo '[diff]' >> $HOME/.gitconfig && \
echo ' colorMoved = default' >> $HOME/.gitconfig

# ------------------- Install LazyDocker ------------------- #
RUN LAZYDOCKER_VERSION=$(curl -s https://api.github.com/repos/jesseduffield/lazydocker/releases/latest | \
jq -r '.tag_name' | \
Expand Down

0 comments on commit 67c5181

Please sign in to comment.