diff --git a/.chezmoidata/packages.toml b/.chezmoidata/packages.toml index b97f930..d85ec6a 100644 --- a/.chezmoidata/packages.toml +++ b/.chezmoidata/packages.toml @@ -26,6 +26,20 @@ casks = [ # 'macvim', ] +# Debian ----------------------------------------------------------------------- +# 特別備註: +# Debain 12 (bookworm) 沒有eza,但是有exa +# Debain 12 (bookworm) 沒有ueberzugpp,但是有ueberzug +# Debain 12 (bookworm) neovim版本太舊 0.7,lazy無法用 +[packages.linux.debian] +apt = [ + 'zsh', + 'vim', + 'neovim', + 'git', + 'exa', +] + # Arch Linux ------------------------------------------------------------------- [packages.linux.arch] pacman_force = [ diff --git a/.chezmoiscripts/run_onchange_after_install.sh.tmpl b/.chezmoiscripts/run_onchange_after_install.sh.tmpl index 2b2c9d9..c344caf 100644 --- a/.chezmoiscripts/run_onchange_after_install.sh.tmpl +++ b/.chezmoiscripts/run_onchange_after_install.sh.tmpl @@ -1,8 +1,14 @@ #!/bin/sh -zsh -i -c 'zinit update' -vim +PlugInstall +qall -nvim --headless "+Lazy! update" +qa +if command -v zsh &> /dev/null; then + zsh -i -c 'zinit update' +fi +if command -v vim &> /dev/null; then + vim +PlugInstall +qall +fi +if command -v nvim &> /dev/null; then + nvim --headless "+Lazy! update" +qa +fi {{ if not .noGUI }} {{ if and (eq .chezmoi.os "linux") (stat (print .chezmoi.homeDir "/.winscp")) }} diff --git a/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl b/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl index 9ec55ff..dddb2b3 100644 --- a/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl +++ b/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl @@ -1,4 +1,25 @@ {{ if eq .chezmoi.os "linux" -}} +{{/* ---- 安裝腳本 ------------------------------------------------------- */ -}} + +{{/* ==== Debian ======================================================== */ -}} +{{ if eq .chezmoi.osRelease.id "debian" -}} + +{{/* ---- 整理待安裝清單 -------------------------------------------------- */ -}} +{{- $aptInstall := .packages.linux.debian.apt -}} +apt_packages=( {{ $aptInstall | quoteList | join " " }} ) + +to_install_apt=() +for package in "${apt_packages[@]}"; do + to_install_apt+=("$package") +done + +echo " - Installing packages via apt: ${to_install_apt[@]}" +if [ "$EUID" -ne 0 ] + sudo apt install -y "${to_install_apt[@]}" +else + apt install -y "${to_install_apt[@]}" +fi +{{ end -}} {{/* ==== Arch Linux / Manjaro ========================================== */ -}} diff --git a/Readme.md b/Readme.md index f1cc451..57d17bf 100644 --- a/Readme.md +++ b/Readme.md @@ -21,11 +21,13 @@ Yuan dotfile 自用環境設定檔 * Manjaro Linux * Arch Linux -目前已經測試過確定可用的環境組合如下: -* macOS 15 Sequoia - 2025/5/2 測試過 -* Manjaro Linux - 2025/5/2 測試過 +目前已經測試過確定可用的環境組合與主要用途如下: +* macOS 15 Sequoia -主要桌面電腦工作開發用 -2025/5/2 測試過 +* Manjaro Linux -主要桌面電腦工作開發用 -2025/5/2 測試過 +* Debian -伺服器主機與Container執行環境用 +* Debian (無Root模式) * Manjaro Linux (無GUI) - 2025/5/2 測試過 -* Arch Linux (無GUI) - 2025/5/2 測試過 +* Arch Linux (無GUI) -2025/5/2 測試過 都是使用一般使用者有sudo權限的帳號,目前測試直接用root帳號可能會有問題。 (尤其是Arch Linux,安裝yay無法使用root帳號) @@ -34,6 +36,14 @@ Yuan dotfile 自用環境設定檔 -------------------------------------------------------------------------------- ### Linux / macOS #### 安裝主dotfiles包 +
+ PS. 若是用Debian Slim 精簡版作業系統,要先安裝 curl + ``` + apt update && apt install curl -y + ``` +
+ +安裝整包設定擋與執行相關腳本 ``` sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply chyuaner ``` diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index d2d7418..3a9a5e9 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -138,6 +138,9 @@ elif command -v eza &> /dev/null; then zinit snippet https://github.com/eza-community/eza/blob/main/completions/zsh/_eza alias ls='eza --color=always --icons=always' #zinit light 'eza-community/eza' +elif command -v exa &> /dev/null; then + compdef exa='ls' + alias ls='exa --color=always --icons' fi # Floorp 支援 Firefox參數補齊