feat(zsh): replace zsh with fish

This commit is contained in:
yeti
2025-05-15 05:37:56 +01:00
parent 9398844e54
commit 9abd983adf
6 changed files with 23 additions and 384 deletions

View File

@ -12,25 +12,33 @@ DEV_HOME=/home/$DEV_USER
ctr=$(buildah from archlinux)
buildah run "$ctr" -- bash -c "\
pacman -Sy --noconfirm && pacman -S --noconfirm --needed base-devel neovim git zsh tmux \
nodejs python podman fzf fd ripgrep jdk-openjdk zsh-completions zsh-syntax-highlighting \
lazygit zsh-autosuggestions luarocks python-pynvim npm bash-completion tree-sitter-cli \
pacman -Sy --noconfirm && pacman -S --noconfirm --needed base-devel neovim git fish tmux \
nodejs python podman fzf fd ripgrep jdk-openjdk fisher yazi \
lazygit luarocks python-pynvim npm bash-completion tree-sitter-cli kitty-terminfo \
lua51 openssh && pacman -Scc --noconfirm && groupadd secproc && groupadd -g $DEV_GID $DEV_USER && \
useradd -ms /bin/zsh -G secproc -u $DEV_UID -g $DEV_GID $DEV_USER && mkdir -m 511 -p $SECURE
useradd -ms /bin/fish -G secproc -u $DEV_UID -g $DEV_GID $DEV_USER && mkdir -m 511 -p $SECURE
"
# copy start script, zshrc, neovim, tmux setup and ssh setup
# copy start script, neovim, tmux setup and ssh setup
buildah copy --chown $DEV_USER:$DEV_USER "$ctr" ./home/. $DEV_HOME
buildah copy "$ctr" 00-allow-git.conf /etc/ssh/ssh_config.d/
# configure lazyvim
buildah run --user $DEV_USER "$ctr" -- bash -c "\
nvim --headless \"+Lazy! sync\" +qa && sleep 1 && \
nvim --headless \"+Lazy! sync\" +qa && sleep 1 && \
nvim --headless \"+Lazy! sync\" +qa && \
mkdir -p $DEV_HOME/.ssh && ssh-keyscan -p 2222 10.88.0.1 >> ~/.ssh/known_hosts && \
ssh-keyscan -p 22 github.com >> ~/.ssh/known_hosts
"
# shellcheck disable=SC2016
buildah run --user "$DEV_USER" "$ctr" -- fish -c '
set -gx HOME '"$DEV_HOME"';
mkdir -p $HOME/.ssh;
ssh-keyscan -p 2222 10.88.0.1 >> $HOME/.ssh/known_hosts;
ssh-keyscan -p 22 github.com >> $HOME/.ssh/known_hosts;
fisher install \
jorgebucaran/fisher \
pure-fish/pure \
patrickf1/fzf.fish \
jorgebucaran/autopair.fish \
gazorby/fish-abbreviation-tips \
jethrokuan/z;
for i in 1 2 3; nvim --headless "+Lazy! sync" +qa; sleep 1; end
'
# lock the files
buildah run "$ctr" -- bash -c "\
@ -40,16 +48,14 @@ buildah run "$ctr" -- bash -c "\
$DEV_HOME/.config/nvim/init.lua \
$DEV_HOME/.config/nvim/README.md \
$DEV_HOME/.config/nvim/LICENSE \
$DEV_HOME/.config/tmux/tmux.conf \
$DEV_HOME/.config/zsh/fzf-git.sh && \
$DEV_HOME/.config/tmux/tmux.conf && \
chown root:secproc $DEV_HOME/start.sh \
$DEV_HOME/.config/lazygit/config.yml \
$DEV_HOME/.config/nvim/lua/config/lazy.lua \
$DEV_HOME/.config/nvim/init.lua \
$DEV_HOME/.config/nvim/README.md \
$DEV_HOME/.config/nvim/LICENSE \
$DEV_HOME/.config/tmux/tmux.conf \
$DEV_HOME/.config/zsh/fzf-git.sh
$DEV_HOME/.config/tmux/tmux.conf
"
buildah config \