diff --git a/.chezmoi.yaml.tmpl b/.chezmoi.yaml.tmpl index 263965e..b840cc1 100644 --- a/.chezmoi.yaml.tmpl +++ b/.chezmoi.yaml.tmpl @@ -76,6 +76,15 @@ data: {{- else if $swayOverrideOff }} sway: false {{- else }} + {{- /* Hostname allowlist for the desktop stack. Match if hostname + equals or starts with any of the listed prefixes (e.g. "byte" + matches both "byte" and "byte-arch"). */}} {{- $swayHosts := list "miche" "byte" "kaiser" }} - sway: {{ has .chezmoi.hostname $swayHosts }} + {{- $swayMatch := false }} + {{- range $swayHosts }} + {{- if or (eq . $.chezmoi.hostname) (hasPrefix (printf "%s-" .) $.chezmoi.hostname) (hasPrefix (printf "%s." .) $.chezmoi.hostname) }} + {{- $swayMatch = true }} + {{- end }} + {{- end }} + sway: {{ $swayMatch }} {{- end }} \ No newline at end of file