From cf5a2f46f0167c8495d28de5b1364c8bc460b6d0 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 19 Jun 2026 17:57:23 +0100 Subject: Migrate VM dotfiles to chezmoi Move VM dotfile deployment out of Home Manager and into chezmoi with a machineRole guard. Add VM recipes for applying chezmoi state and restarting the Nix GnuPG agent. Make host-only hooks no-op on the VM and render container storage per role. --- .chezmoi.toml.tmpl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '.chezmoi.toml.tmpl') diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index f7b1156..3582b7e 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -1,3 +1,5 @@ +{{- $defaultMachineRole := default "host" (env "CHEZMOI_MACHINE_ROLE") -}} +{{- $machineRole := promptStringOnce . "machineRole" "Machine role (host or vm)" $defaultMachineRole -}} sourceDir = {{ .chezmoi.sourceDir | quote }} [status] @@ -7,7 +9,11 @@ sourceDir = {{ .chezmoi.sourceDir | quote }} exclude = ["scripts"] [data] + # Machine role used by templates and run hooks. Valid values: "host", "vm". + machineRole = {{ $machineRole | quote }} +{{- if eq $machineRole "host" }} # Block device holding the LUKS-encrypted root, without the /dev/ prefix # (e.g. "nvme0n1p2", "sda2"). Resolved to a UUID at apply time via lsblk, # used by etc/kernel/cmdline.tmpl. luksRootPartition = {{ promptStringOnce . "luksRootPartition" "LUKS root partition (e.g. nvme0n1p2)" | quote }} +{{- end }} -- cgit v1.3.1