mirror of
https://github.com/Xevion/dotfiles.git
synced 2026-01-31 02:24:11 -06:00
config: make fish_plugins conditional and add PATH entries
- Convert fish_plugins to template with conditional sdkman plugin - Add humanlog and foundry to PATH in commonrc scripts - Fix WSL chassis detection by moving WSL check earlier
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
{{- /* Detect if running in WSL first (needed for chassis detection) */ -}}
|
||||
{{- $wsl := false -}}
|
||||
{{- if eq .chezmoi.os "linux" -}}
|
||||
{{- $wsl = (.chezmoi.kernel.osrelease | lower | contains "microsoft") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Detect chassis type (likely: laptop | desktop | container) */ -}}
|
||||
{{- /* Chassis type mapping: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.6.0.pdf */ -}}
|
||||
{{- $chassisType := "desktop" }}
|
||||
@@ -7,7 +13,7 @@
|
||||
{{- else }}
|
||||
{{- $chassisType = "desktop" }}
|
||||
{{- end }}
|
||||
{{- else if eq .chezmoi.os "linux" }}
|
||||
{{- else if and (eq .chezmoi.os "linux") (not $wsl) }}
|
||||
{{- $chassisRaw := output "cat" "/sys/class/dmi/id/chassis_type" | trim }}
|
||||
{{- if or (eq $chassisRaw "8") (eq $chassisRaw "9") (eq $chassisRaw "10") (eq $chassisRaw "14") }}
|
||||
{{- $chassisType = "laptop" }}
|
||||
@@ -16,7 +22,7 @@
|
||||
{{- else }}
|
||||
{{- $chassisType = "desktop" }}
|
||||
{{- end }}
|
||||
{{- else if eq .chezmoi.os "windows" }}
|
||||
{{- else if or (eq .chezmoi.os "windows") $wsl }}
|
||||
{{- $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 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -34,11 +40,7 @@
|
||||
{{- $cpuThreads = (output "powershell.exe" "-NoProfile" "-NonInteractive" "-Command" "(Get-CimInstance -ClassName 'Win32_Processor').NumberOfLogicalProcessors") | trim | atoi }}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Detect if running in WSL */ -}}
|
||||
{{- $wsl := false -}}
|
||||
{{- if eq .chezmoi.os "linux" -}}
|
||||
{{- $wsl = (.chezmoi.kernel.osrelease | lower | contains "microsoft") -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
encryption = "age"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user