From aff435a0fb3a56b1d7b738c7dede363440884b3a Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Thu, 17 Sep 2026 15:05:36 +0100 Subject: Add the Canonical laptop profile and setup workflows --- just-lib.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'just-lib.sh') diff --git a/just-lib.sh b/just-lib.sh index 1846c26..5caa79f 100644 --- a/just-lib.sh +++ b/just-lib.sh @@ -91,3 +91,20 @@ _undeclared_packages() { done fi } +_machine_role() { + role=$(chezmoi data -S "${DOTFILES_SOURCE:-.}" | jq -er '.machineRole') || return 1 + case "$role" in + host | vm | canonical) printf '%s\n' "$role" ;; + *) + echo 'error: initialize chezmoi with host, vm, or canonical role first' >&2 + return 1 + ;; + esac +} + +_require_host() { + [ "$(_machine_role)" = host ] || { + echo 'error: this recipe is for the Arch host only' >&2 + return 1 + } +} -- cgit v1.3.1