fix chassis detection with hostnamectl

This commit is contained in:
Lockszmith (VAST@MacBook) 2025-04-18 17:07:18 -04:00
parent 1110cb3dc7
commit 0ef9b714ec
1 changed files with 4 additions and 4 deletions

View File

@ -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" }}