Tadbit (tadbit-gentoo, x86_64, gcc 15.2.1, TKG kernel) joins the
homelab as the 7th machine — the first gentoo box. Adds Gentoo
support to the bootstrap alongside arch and debian.
New scripts:
- run_once_10-add-gentoo-overlays.sh.tmpl: enables GURU overlay
via 'eselect repository enable guru' + 'emaint sync -r guru'.
Idempotent — skips if GURU is already at /var/db/repos/guru.
GURU is required because eza, lazygit, topgrade, and most modern
CLI tools only live in GURU (not main).
- run_once_20-install-user-packages-gentoo.sh.tmpl: emerge-based
user package set. Writes USE flags to package.use/ BEFORE
emerging so foot/wofi/waybar get the right features. Detects
missing packages via 'command -v <basename>'. Falls back to
the official curl installer for bun (no gentoo package).
- run_once_40-install-sway-gentoo.sh.tmpl: sway stack via emerge
with USE flags for X+wayland+tray+upower+wireplumber.
Updated scripts:
- .chezmoi.yaml.tmpl: os_family detection now also matches 'gentoo'.
Critical fix: Gentoo's /etc/os-release uses single-quoted values
('gentoo' not 'gentoo' or "gentoo"), and chezmoi's parser doesn't
strip them. Without trimAll "'", .chezmoi.osRelease.id returns
the literal string 'gentoo' with quotes, and the eq test fails.
Symptom: os_family silently becomes 'unknown'.
- run_once_00-install-bootstrap-tools.sh.tmpl: added gentoo branch
that uses emerge --sync + emerge (skipping if tree is < 1 day old).
- run_onchange_30-ensure-cargo.sh.tmpl: added gentoo branch for
bat (already installed by emerge, just verify), topgrade (GURU),
cargo-update (dev-util/cargo-update in main).
README: documented Gentoo-specific quirks (USE flags, GURU,
single-quote parsing, no binary packages).
97 lines
No EOL
4.8 KiB
Cheetah
97 lines
No EOL
4.8 KiB
Cheetah
{{- $osFamily := "unknown" -}}
|
|
{{- $idLike := "" -}}
|
|
{{- if hasKey .chezmoi.osRelease "idLike" -}}
|
|
{{- $idLike = .chezmoi.osRelease.idLike -}}
|
|
{{- end -}}
|
|
{{- $osId := .chezmoi.osRelease.id -}}
|
|
{{- /* Gentoo's /etc/os-release uses single-quoted values (e.g. ID='gentoo'),
|
|
and the parser doesn't strip them, so strip here. Other distros use
|
|
double-quoted or unquoted values which the parser handles. */ -}}
|
|
{{- if hasPrefix "'" $osId -}}
|
|
{{- $osId = trimAll "'" $osId -}}
|
|
{{- end -}}
|
|
{{- if or (eq $osId "arch") (contains "arch" $idLike) -}}
|
|
{{- $osFamily = "arch" -}}
|
|
{{- else if or (eq $osId "debian") (contains "debian" $idLike) -}}
|
|
{{- $osFamily = "debian" -}}
|
|
{{- else if eq $osId "gentoo" -}}
|
|
{{- $osFamily = "gentoo" -}}
|
|
{{- end -}}
|
|
encryption: "age"
|
|
# chezmoi's builtin age implementation requires a TTY for passphrase-style
|
|
# decryption prompts and doesn't support all features. Force the external
|
|
# age binary instead. If chezmoi can't find `age` on PATH at apply time,
|
|
# the absolute path is used as a fallback.
|
|
useBuiltinAge: false
|
|
sourceDir: {{ .chezmoi.sourceDir | quote }}
|
|
|
|
# age config — see https://www.chezmoi.io/user-guide/encryption/age/
|
|
#
|
|
# To bootstrap age on a new box:
|
|
# 1. Generate a recovery key (offline, store secret in password manager):
|
|
# age-keygen -o ~/.config/chezmoi/keys/recovery.key
|
|
# Add the printed public key below as a recipient.
|
|
# 2. Generate a per-machine key on each box:
|
|
# age-keygen -o ~/.config/chezmoi/key.txt
|
|
# Add its public key below, then `chezmoi age rekey` to rewrite *.age files.
|
|
#
|
|
# To encrypt a new secret:
|
|
# echo 'secret' | chezmoi encrypt --output private_dot_.../<name>.age
|
|
#
|
|
# To decrypt (auto, on apply):
|
|
# chezmoi uses ~/.config/chezmoi/key.txt (per-machine) by default.
|
|
|
|
age:
|
|
# Absolute path to age binary. Most distros install to /usr/bin/age;
|
|
# Arch's pacman and Debian's apt both put it there. Using the absolute
|
|
# path means chezmoi can find age even if PATH isn't set correctly
|
|
# (which happens in some non-interactive SSH contexts).
|
|
#
|
|
# On a per-machine bootstrap, this might not be installed yet (sudo
|
|
# required). The bootstrap detects the fallback path and re-renders
|
|
# the config to use it. See run_once_00-install-bootstrap-tools.sh.tmpl.
|
|
{{- if stat "/usr/bin/age" }}
|
|
command: "/usr/bin/age"
|
|
{{- else if stat (joinPath .chezmoi.homeDir ".local/bin/age") }}
|
|
command: "{{ joinPath .chezmoi.homeDir ".local/bin/age" }}"
|
|
{{- else if stat "/usr/local/bin/age" }}
|
|
command: "/usr/local/bin/age"
|
|
{{- end }}
|
|
identity: "~/.config/chezmoi/key.txt"
|
|
|
|
# Multiple recipients: every listed recipient can decrypt every *.age file.
|
|
# Add a new recipient by pasting their public key below, then
|
|
# `chezmoi age rekey` to rewrite existing files with the new recipient.
|
|
recipients:
|
|
# Recovery key — secret stored offline (password manager, USB stick).
|
|
# Don't lose this: it's the only way to recover secrets if every
|
|
# machine key is lost.
|
|
- age1yyq42ctqwp5s5yd64week3aav9getk3p8aeyr5n5454d0v59a4dsjljsgs
|
|
|
|
# Per-machine keys — one per box. Generate on the box itself with
|
|
# `age-keygen -o ~/.config/chezmoi/key.txt`, paste its public key
|
|
# here, then `chezmoi age rekey`.
|
|
- age1eja7trs8mmsgf0qga0h5fsdltaryxgk4ksumshar5xxtdx0exy3q0a5hc5 # miche (Strix Halo GPU host)
|
|
- age1tzmsrw59zkvh47pwz66gly3s4hdcru76569s8cgv0syfrpmutdxsnlke30 # byte (CachyOS laptop)
|
|
- age16pl6ad3r44hf3q70xra7fadmllhmnnpmksetr3hr6a0q55kd3f9slvpsdg # kaiser (services host)
|
|
- age14yfcz6k3m4q99nuvd22ka8zgtgj6q5jmt0sz3cz0004uhcgddfpq49kxw7 # rye (Debian Pi)
|
|
- age19d0dqm6nzmhlhuns2qa3z64rua294xvf6l2uy5we5dlrq6z4yvwq6g4y4e # crouton (Debian Pi)
|
|
- age1jk0xy6ltmd00x36jswxlj9c94pap3yu82usj2lzsxnqqdtngupnsyqjyv4 # bit (CachyOS laptop)
|
|
|
|
data:
|
|
os_family: {{ $osFamily | quote }}
|
|
os_id: {{ $osId | quote }}
|
|
|
|
# Sway/Wayland desktop stack — opt-in at bootstrap time. When you
|
|
# run `chezmoi init` for the first time, you'll be asked:
|
|
# "Install the sway + wofi + foot Wayland desktop stack? [y/N]"
|
|
# Answering `y` installs the packages and writes the configs.
|
|
# Answering `N` (or pressing enter for default) skips both.
|
|
#
|
|
# To flip later: `touch ~/.config/chezmoi/features/sway` to enable,
|
|
# or `touch ~/.config/chezmoi/features/no-sway` to disable, then
|
|
# `chezmoi apply`. The marker files override the bootstrap answer.
|
|
{{- $swayMarker := not (not (stat (joinPath .chezmoi.homeDir ".config/chezmoi/features/sway"))) }}
|
|
{{- $noSwayMarker := not (not (stat (joinPath .chezmoi.homeDir ".config/chezmoi/features/no-sway"))) }}
|
|
{{- $swayPrompt := promptBool "sway_setup" false }}
|
|
sway_setup: {{ or $swayMarker (and $swayPrompt (not $noSwayMarker)) }} |