dotfiles/home/dot_config/metapac/config.toml.tmpl
Felipe M. 54965e17aa
Add Laugh-Tale and fix three faults that blocked any macOS host
Registering the first Mac surfaced problems that would have hit every
future one, not just this machine:

metapac keys off a raw gethostname(), which on macOS carries the mDNS
".local" suffix, while the registry is keyed by chezmoi's
.chezmoi.hostname, which stops at the first dot. A bare key never
matched and metapac refused to run at all. config.toml.tmpl now emits
each host twice, bare and ".local", so nothing in the registry has to
declare which machines are Macs; the spare key is inert elsewhere.

chezmoi was rewriting ~/Library from 0700 to 0755 on every apply,
loosening a directory macOS deliberately closes. Both levels now carry
the private_ prefix.

dot_gitconfig.tmpl would have destroyed real config on adoption: the
git-lfs filters, seven aliases, diff.noprefix, rerere and the gh
credential helper. All folded in. The lfs block and the GitHub helper
are lookPath-gated like the signing block -- lfs filters run on every
checkout and abort wholesale when the binary is missing, so asserting
them unconditionally breaks a minimal box rather than degrading. gh's
path comes from lookPath, not a hardcoded /opt/homebrew/bin/gh.

Laugh-Tale takes common + a new darwin group, the macOS counterpart to
archlinux.toml, holding only the tooling a backend needs. Its baseline
captures 325 packages, 24 taps and 21 App Store apps -- without it
`metapac clean` would offer to remove every one of them.

Verified on Laugh-Tale: chezmoi status clean after apply, ~/Library
still 0700, `metapac unmanaged` reports nothing, `metapac sync` is a
no-op, and the status line renders correctly under macOS bash 3.2.

Shared groups are still arch-only, so this host draws nothing from
common yet; that gap is documented, not closed.

Claude-Session: https://claude.ai/code/session_01BvpSVPsLrUK4N53LVTofR8
2026-08-25 23:08:01 +02:00

46 lines
1.9 KiB
Go Template

# Generated by chezmoi from home/dot_config/metapac/config.toml.tmpl
# Machine list lives in home/.chezmoidata/hosts.toml -- edit that, not this.
#
# metapac reads this from the platform config dir:
# Linux $XDG_CONFIG_HOME/metapac/config.toml
# macOS ~/Library/Application Support/metapac/config.toml (symlinked to ~/.config/metapac)
# Backends enabled on every host; merged with [hostname_enabled_backends].
enabled_backends = []
# Only the group files listed in [hostname_groups] are used, instead of every
# .toml found under groups/.
hostname_groups_enabled = true
# Each host is emitted twice: under its bare name, and under "<name>.local".
# metapac keys off a raw gethostname(), which on macOS carries the mDNS ".local"
# suffix, while the registry is keyed by chezmoi's .chezmoi.hostname, which stops
# at the first dot. Without the alias every macOS host falls through to
# "no entry in the `hostname_groups` config" and metapac refuses to run. The
# spare key is inert on hosts that report a bare name.
[hostname_enabled_backends]
{{- range $name, $h := .hosts }}
{{ $name | quote }} = {{ $h.backends | toJson }}
{{ printf "%s.local" $name | quote }} = {{ $h.backends | toJson }}
{{- end }}
# Every host implicitly gets its own baseline group, groups/hosts/<hostname>.toml,
# holding the packages the OS install left behind. This is what keeps
# `metapac clean` from offering to uninstall base, sudo and the kernel.
# A host with no baseline file fails loudly on the next metapac run, naming the
# path to create -- that is deliberate.
[hostname_groups]
{{- range $name, $h := .hosts }}
{{- $g := prepend $h.groups (printf "hosts/%s" $name) }}
{{ $name | quote }} = {{ $g | toJson }}
{{ printf "%s.local" $name | quote }} = {{ $g | toJson }}
{{- end }}
[arch]
# pacman, pamac, paru, pikaur and yay share a package database, so metapac needs
# to be told which one to drive.
package_manager = "paru"
[cargo]
locked = false
binstall = false