先試做 unRoot mode: eza和neovim

This commit is contained in:
Yuan Chiu 2025-05-04 16:58:28 +08:00
parent d62459930e
commit 437eeec224
2 changed files with 33 additions and 2 deletions

View File

@ -14,3 +14,26 @@
url = "https://github.com/alacritty/alacritty-theme"
refreshPeriod = "168h"
{{ end }}
{{ if and .unRootMode (eq .chezmoi.arch "amd64")}}
{{/* eza */ -}}
{{ $ezaVersion := "v0.21.3" -}}
[".local/bin/eza"]
type = "archive-file"
url = "https://github.com/eza-community/eza/releases/download/{{ $ezaVersion }}/eza_x86_64-unknown-{{ .chezmoi.os }}-gnu.tar.gz"
path = "eza"
{{/* neovim */ -}}
{{ $nvimVersion := "v0.11.1" -}}
[".local"]
type = "archive"
url = "https://github.com/neovim/neovim/releases/{{ $nvimVersion }}download/nvim-{{ .chezmoi.os }}-x86_64.tar.gz"
exact = true
stripComponents = 1
path = "nvim-linux-x86_64"
{{/* zsh */ -}}
{{/* lazygit */ -}}
{{ end }}

View File

@ -1,12 +1,20 @@
{{ if eq .chezmoi.os "linux" -}}
#!/bin/bash
{{/* **** unRoot Mode *************************************************** */ -}}
{{ if .unRootMode -}}
{{/* 如果強制設定unRoot */}}
{{/* 或是沒有.chezmoi.osRelease.id因為環境有可能是Synology極精簡環境直接視同unRoot Mode處理 */}}
{{ if or .unRootMode (not (hasKey .chezmoi.osRelease "id")) -}}
{{/* 部份已由.chezmoiexternal.toml處理了 */ -}}
{{/* 其他自訂手動安裝腳本: */ -}}
{{/* 手動安裝 eza */ -}}
# if command -v eza &> /dev/null; then
#
# fi
{{/* **** Root Mode ***************************************************** */ -}}
{{ else -}}
#!/bin/bash
{{/* ==== Debian ======================================================== */ -}}
{{ if or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "ubuntu") -}}