#!/bin/sh # Deploy system-level configs from etc/ to /etc/. # chezmoi re-runs this script whenever any file under etc/ changes. # etc/ content hash: {{ output "sh" "-c" (printf "cd %q && find etc -type f ! -name .ignore -exec sha256sum {} + | LC_ALL=C sort" .chezmoi.sourceDir) | sha256sum }} set -eu cd "$CHEZMOI_SOURCE_DIR" find etc -type f ! -name .ignore | while IFS= read -r src; do dest="/${src}" doas install -D -m 0644 -o root -g root "$src" "$dest" done # doas refuses to parse /etc/doas.conf unless it's 0400 root:root doas chmod 0400 /etc/doas.conf