2025-02-21 03:24:38 +00:00
|
|
|
# This .chezmoi.toml file is used once only
|
|
|
|
# It collects information about the system in order to determine
|
|
|
|
# which of the _home.* dirs will be set as the .chezmoiroot
|
2025-03-12 14:55:31 +00:00
|
|
|
|
2025-04-15 16:11:55 +00:00
|
|
|
{{- $githubToken := promptStringOnce . "githubToken" "Public GITHUB token (mostly for rate limits - !insecure!)" (or (
|
|
|
|
env "CZ_GITHUB_ACCESS_TOKEN"
|
|
|
|
) ( env "CHEZMOI_GITHUB_ACCESS_TOKEN"
|
|
|
|
) ( env "GITHUB_ACCESS_TOKEN"
|
|
|
|
) ( env "GITHUB_TOKEN"
|
|
|
|
)) -}}
|
2025-04-15 17:44:39 +00:00
|
|
|
{{- $scriptTempDir := or (env "CZ_SCRIPT_TEMPDIR") "~/.cache/chezmoi/tmp" }}
|
2025-04-15 16:11:55 +00:00
|
|
|
|
2025-02-21 03:24:38 +00:00
|
|
|
{{- $chassisType := "desktop" }}
|
|
|
|
{{- $sysType := "posix" }}
|
2025-03-10 20:49:05 +00:00
|
|
|
{{- $sysVendor := "unknown" }}
|
2025-02-21 03:24:38 +00:00
|
|
|
{{- if eq .chezmoi.os "darwin" }}
|
|
|
|
{{- $sysType = "macos" }}
|
2025-04-15 16:11:55 +00:00
|
|
|
{{- $sysVendor = "apple" }}
|
2025-02-21 03:24:38 +00:00
|
|
|
{{- if contains "BatteryData" (output "ioreg" "-c" "AppleSmartBattery") }}
|
|
|
|
{{- $chassisType = "laptop" }}
|
|
|
|
{{- else }}
|
|
|
|
{{- $chassisType = "desktop" }}
|
|
|
|
{{- end }}
|
|
|
|
{{- else if eq .chezmoi.os "linux" }}
|
2025-04-15 16:11:55 +00:00
|
|
|
{{- $chassisType = or (and
|
|
|
|
(lookPath "hostnamectl") (output "hostnamectl" "--json=short" | mustFromJson).Chassis
|
|
|
|
)
|
|
|
|
"server"
|
|
|
|
}}
|
2025-02-21 03:24:38 +00:00
|
|
|
{{- else if eq .chezmoi.os "windows" }}
|
|
|
|
{{- $sysType = "windows" }}
|
2025-04-15 16:11:55 +00:00
|
|
|
{{- $sysVendor = "pc" }}
|
2025-02-21 03:24:38 +00:00
|
|
|
{{- $chassisType = (output "powershell.exe" "-NoProfile" "-NonInteractive" "-Command" "if ((Get-CimInstance -Class Win32_Battery | Measure-Object).Count -gt 0) { Write-Output 'laptop' } else { Write-Output 'desktop' }") | trim }}
|
2025-04-15 17:44:39 +00:00
|
|
|
{{- end -}}
|
2025-02-21 03:24:38 +00:00
|
|
|
|
2025-04-15 17:44:39 +00:00
|
|
|
#
|
2025-03-11 12:08:29 +00:00
|
|
|
scriptTempDir={{- $scriptTempDir | quote }}
|
|
|
|
|
2025-02-21 03:24:38 +00:00
|
|
|
[scriptEnv]
|
2025-03-11 12:08:29 +00:00
|
|
|
CZ_SCRIPT_TEMPDIR={{- $scriptTempDir | quote }}
|
|
|
|
CZ_CHASSIS={{- $chassisType | quote }}
|
|
|
|
CZ_SYS={{- $sysType | quote }}
|
|
|
|
CZ_OS={{- .chezmoi.os | quote }}
|
2025-03-12 14:55:31 +00:00
|
|
|
CZ_GITHUB_ACCESS_TOKEN={{- $githubToken | quote }}
|
2025-04-15 16:11:55 +00:00
|
|
|
CZ_VENDOR={{- $sysVendor | quote }}
|
|
|
|
|