Initial chezmoi setup

Manage zsh, kitty, and starship configs across Fedora/Gentoo.
sysup() is Fedora-only via template conditional.
Deno completions generated via run_once_after script.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Joshua Hirsig 2026-02-18 15:44:02 +01:00
commit b0db8cf9f0
6 changed files with 291 additions and 0 deletions

11
.chezmoi.toml.tmpl Normal file
View file

@ -0,0 +1,11 @@
{{- $distro := "" -}}
{{- if stat "/etc/os-release" -}}
{{- range (split "\n" (include "/etc/os-release")) -}}
{{- if hasPrefix "ID=" . -}}
{{- $distro = trimPrefix "ID=" . -}}
{{- end -}}
{{- end -}}
{{- end -}}
[data]
distro = {{ $distro | quote }}

View file

@ -0,0 +1,51 @@
# Font (matching Ptyxis/Ghostty setup)
font_family FiraCode Nerd Font Light
bold_font FiraCode Nerd Font Bold
italic_font auto
bold_italic_font auto
font_size 12.0
# Ghostty color scheme (Tomorrow Night variant)
background #282c34
foreground #ffffff
color0 #1d1f21
color1 #cc6666
color2 #b5bd68
color3 #f0c674
color4 #81a2be
color5 #b294bb
color6 #8abeb7
color7 #c5c8c6
color8 #666666
color9 #d54e53
color10 #b9ca4a
color11 #e7c547
color12 #7aa6da
color13 #c397d8
color14 #70c0b1
color15 #eaeaea
# Cursor
cursor #ffffff
cursor_text_color #282c34
# Selection
selection_foreground #282c34
selection_background #c5c8c6
# Tab bar
tab_bar_style powerline
tab_powerline_style slanted
active_tab_background #81a2be
active_tab_foreground #282c34
inactive_tab_background #1d1f21
inactive_tab_foreground #c5c8c6
# Window
window_padding_width 4
confirm_os_window_close 0
# Wayland
wayland_titlebar_color background
linux_display_server wayland

145
dot_config/starship.toml Normal file
View file

@ -0,0 +1,145 @@
format = """
[](#9A348E)\
$os\
$username\
[](bg:#DA627D fg:#9A348E)\
$directory\
[](fg:#DA627D bg:#FCA17D)\
$git_branch\
$git_status\
[](fg:#FCA17D bg:#86BBD8)\
$c\
$elixir\
$elm\
$golang\
$gradle\
$haskell\
$java\
$julia\
$nodejs\
$nim\
$rust\
$scala\
[](fg:#86BBD8 bg:#06969A)\
$docker_context\
[](fg:#06969A bg:#33658A)\
$time\
[ ](fg:#33658A)\
"""
# Disable the blank line at the start of the prompt
# add_newline = false
# You can also replace your username with a neat symbol like  or disable this
# and use the os module below
[username]
show_always = true
style_user = "bg:#9A348E"
style_root = "bg:#9A348E"
format = '[$user ]($style)'
disabled = false
# An alternative to the username module which displays a symbol that
# represents the current operating system
[os]
style = "bg:#9A348E"
disabled = false # Disabled by default
[directory]
style = "bg:#DA627D"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"
# Here is how you can shorten some long paths by text replacement
# similar to mapped_locations in Oh My Posh:
[directory.substitutions]
"Documents" = "󰈙 "
"Downloads" = " "
"Music" = " "
"Pictures" = " "
"Devel" = "Ꙭ "
# Keep in mind that the order matters. For example:
# "Important Documents" = " 󰈙 "
# will not be replaced, because "Documents" was already substituted before.
# So either put "Important Documents" before "Documents" or use the substituted version:
# "Important 󰈙 " = " 󰈙 "
[c]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[docker_context]
symbol = " "
style = "bg:#06969A"
format = '[ $symbol $context ]($style)'
[elixir]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[elm]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[git_branch]
symbol = ""
style = "bg:#FCA17D"
format = '[ $symbol $branch ]($style)'
[git_status]
style = "bg:#FCA17D"
format = '[$all_status$ahead_behind ]($style)'
[golang]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[gradle]
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[haskell]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[java]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[julia]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[nodejs]
symbol = ""
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[nim]
symbol = "󰆥 "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[rust]
symbol = ""
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[scala]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'
[time]
disabled = false
time_format = "%R" # Hour:Minute Format
style = "bg:#33658A"
format = '[ ♥ $time ]($style)'

1
dot_zshenv Normal file
View file

@ -0,0 +1 @@
. "$HOME/.cargo/env"

68
dot_zshrc.tmpl Normal file
View file

@ -0,0 +1,68 @@
# Path (consolidated - no need for .deno/env and .local/bin/env)
export PATH="$HOME/.local/bin:$HOME/.deno/bin:$HOME/.juliaup/bin:$PATH"
export FPATH="$HOME/completions:$FPATH"
# Oh My Zsh
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
HYPHEN_INSENSITIVE="true"
zstyle ':omz:update' mode auto
zstyle ':omz:update' frequency 13
ENABLE_CORRECTION="true"
COMPLETION_WAITING_DOTS="true"
HIST_STAMPS="dd.mm.yyyy"
plugins=(git)
# Cache compinit - only regenerate once per day
zstyle ':omz:alpha:lib:completion' caching yes
source $ZSH/oh-my-zsh.sh
{{- if eq .distro "fedora" }}
# Aliases
sysup() {
command sudo -v || return 1
setopt LOCAL_OPTIONS NO_NOTIFY NO_MONITOR
local dnlog=$(mktemp) fplog=$(mktemp) rslog=$(mktemp) dnolog=$(mktemp) nplog=$(mktemp)
local start=$SECONDS
command sudo dnf up -y &>"$dnlog" &
local -a pids=($!) names=(dnf)
setsid flatpak upgrade -y &>"$fplog" &
pids+=($!); names+=(flatpak)
rustup update &>"$rslog" &
pids+=($!); names+=(rustup)
deno upgrade &>"$dnolog" &
pids+=($!); names+=(deno)
command sudo npm update -g --fund=false --loglevel=error &>"$nplog" &
pids+=($!); names+=(npm)
local spin='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏' i=0
while true; do
local running=() done_count=0
for j in {1..${#pids}}; do
kill -0 ${pids[$j]} 2>/dev/null && running+=("${names[$j]}") || ((done_count++))
done
(( ${#running} == 0 )) && break
printf "\r\033[K \033[33m${spin:$((i%${#spin})):1}\033[0m %d/%d done · %s" \
"$done_count" "${#pids}" "${(j:, :)running}"
((i++)); sleep 0.1
done
printf "\r\033[K"
wait
for label log in dnf "$dnlog" flatpak "$fplog" rustup "$rslog" deno "$dnolog" npm "$nplog"; do
printf "\n\033[1;36m--- %s ---\033[0m\n" "$label"; cat "$log"
done
rm -f "$dnlog" "$fplog" "$rslog" "$dnolog" "$nplog"
printf "\n\033[1;32m✓ Done in %ds\033[0m\n" "$((SECONDS - start))"
}
{{- end }}
# Tools (cached init for faster startup)
if [[ ! -f ~/.cache/zsh/zoxide.zsh ]] || (( $(date +%s) - $(stat -c %Y ~/.cache/zsh/zoxide.zsh 2>/dev/null || echo 0) > 86400 )); then
mkdir -p ~/.cache/zsh
zoxide init zsh > ~/.cache/zsh/zoxide.zsh
starship init zsh > ~/.cache/zsh/starship.zsh
fi
source ~/.cache/zsh/zoxide.zsh
source ~/.cache/zsh/starship.zsh
# CHROME_BIN (resolved on demand, not every shell start)
export CHROME_BIN="${CHROME_BIN:-$(command -v chromium-browser 2>/dev/null || command -v chromium 2>/dev/null || command -v google-chrome 2>/dev/null)}"

View file

@ -0,0 +1,15 @@
#!/bin/bash
# Generate deno zsh completions if deno is installed
if ! command -v deno &>/dev/null; then
echo "deno not found, skipping completions"
exit 0
fi
mkdir -p "$HOME/completions"
mkdir -p "$HOME/.oh-my-zsh/custom/plugins/deno"
deno completions zsh > "$HOME/completions/_deno"
cp "$HOME/completions/_deno" "$HOME/.oh-my-zsh/custom/plugins/deno/_deno"
echo "deno completions installed"