1
0
Fork 0

Add Gentoo support with GURU overlay requirement

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).
This commit is contained in:
Rain 2026-06-23 15:55:28 -04:00
parent 1b596bd894
commit 36e9d3e0ce
7 changed files with 439 additions and 12 deletions

View file

@ -12,7 +12,7 @@ Remote: `https://git.melonbread.xyz/rain/gnu-plus-dotfiles.git` (HTTPS for boots
## What's in here
```
.chezmoi.yaml.tmpl os_family detection (debian | arch)
.chezmoi.yaml.tmpl os_family detection (debian | arch | gentoo)
dot_zshrc.tmpl zsh config with os_family-conditional aliases
dot_tmux.conf tmux + tpm + gruvbox plugin stack
dot_gitconfig.tmpl git + delta
@ -29,14 +29,27 @@ dot_config/
waybar/ waybar status bar
mako/ (arch-only) mako notification daemon
run_once_00-install-bootstrap-tools.sh.tmpl
run_once_00-install-bootstrap-tools.sh.tmpl age, curl, git, base-devel (pacman/apt/emerge)
run_once_05-install-hosts.sh.tmpl merge LAN host entries into /etc/hosts
run_once_10-add-chaotic-aur.sh.tmpl (arch-only)
run_once_20-install-user-packages.sh.tmpl
run_onchange_30-ensure-cargo.sh.tmpl
run_once_40-install-sway.sh.tmpl (desktops only) sway + wofi + foot
run_once_10-add-chaotic-aur.sh.tmpl (arch-only) chaotic-aur + paru
run_once_10-add-gentoo-overlays.sh.tmpl (gentoo-only) enable GURU overlay
run_once_20-install-user-packages.sh.tmpl (arch+debian) user package set
run_once_20-install-user-packages-gentoo.sh.tmpl (gentoo-only) user package set via emerge
run_onchange_30-ensure-cargo.sh.tmpl rustup + bat/topgrade/cargo-update (all 3 OSes)
run_once_40-install-sway.sh.tmpl (arch+debian) sway + wofi + foot
run_once_40-install-sway-gentoo.sh.tmpl (gentoo-only) sway stack via emerge
```
## Gentoo notes
Gentoo support was added 2026-06-23 with the GURU overlay requirement. Key differences from arch/debian:
- **No binary packages by default**`emerge` compiles from source. The bootstrap scripts set `--ask=n --nospinner --quiet-build --keep-going` so installs don't prompt and don't abort on a single failure.
- **USE flags matter**`run_once_20-install-user-packages-gentoo.sh` writes to `/etc/portage/package.use/zz-gentoo-bootstrap` BEFORE emerging, so the right features are enabled for `eza`, `foot`, `waybar`, etc.
- **GURU overlay is required**`run_once_10-add-gentoo-overlays.sh` runs `eselect repository enable guru` + `emaint sync -r guru`. Many user packages (eza, lazygit, topgrade) live in GURU; the main tree alone won't suffice.
- **Per-machine os-release parsing** — Gentoo's `/etc/os-release` uses single-quoted values (e.g. `ID='gentoo'`), and the parser doesn't strip them, so the `os_family` template strips them with `trimAll "'"`. Without that fix, `.chezmoi.osRelease.id` returns `'gentoo'` (with literal quotes), and the `eq "gentoo"` test fails.
- **bun is not in any gentoo overlay** — the official curl installer (`curl -fsSL https://bun.sh/install | bash`) is the fallback path, just like debian.
## Onboarding a new box
**One command.** Copy/paste this on a fresh debian-stable or arch-base install: