chezmoi 新增Debian支援

This commit is contained in:
Yuan Chiu 2025-05-02 16:53:31 +08:00
parent 79d6ecf6b3
commit db6f8611a4
5 changed files with 61 additions and 7 deletions

View File

@ -26,6 +26,20 @@ casks = [
# 'macvim',
]
# Debian -----------------------------------------------------------------------
# 特別備註:
# Debain 12 (bookworm) 沒有eza但是有exa
# Debain 12 (bookworm) 沒有ueberzugpp但是有ueberzug
# Debain 12 (bookworm) neovim版本太舊 0.7lazy無法用
[packages.linux.debian]
apt = [
'zsh',
'vim',
'neovim',
'git',
'exa',
]
# Arch Linux -------------------------------------------------------------------
[packages.linux.arch]
pacman_force = [

View File

@ -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")) }}

View File

@ -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 ========================================== */ -}}

View File

@ -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包
<details>
<summary>PS. 若是用Debian Slim 精簡版作業系統,要先安裝 curl</summary>
```
apt update && apt install curl -y
```
</details>
安裝整包設定擋與執行相關腳本
```
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply chyuaner
```

View File

@ -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參數補齊