From 0ef9b714ec5c61e36cced09c25d6f7be9612e1ea Mon Sep 17 00:00:00 2001 From: "Lockszmith (VAST@MacBook)" Date: Fri, 18 Apr 2025 17:07:18 -0400 Subject: [PATCH] fix chassis detection with hostnamectl --- .chezmoi.toml.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index bed3796..66c0d3f 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -22,10 +22,10 @@ {{- $chassisType = "desktop" }} {{- end }} {{- else if eq .chezmoi.os "linux" }} -{{- $chassisType = or (and - (lookPath "hostnamectl") (output "hostnamectl" "--json=short" | mustFromJson).Chassis - ) - "server" +{{- $chassisType = (and + (lookPath "hostnamectl") + ( regexReplaceAll "Chassis:\\s*" (regexFind "Chassis:\\s*\\S+" (output "hostnamectl" "status")) "" ) + ) | default "server" }} {{- else if eq .chezmoi.os "windows" }} {{- $sysType = "windows" }}