-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.chezmoi.toml.tmpl
More file actions
53 lines (50 loc) · 2.85 KB
/
.chezmoi.toml.tmpl
File metadata and controls
53 lines (50 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# THIS FILE IS MANAGED BY CHEZMOI!
# https://www.chezmoi.io/user-guide/machines/general/#determine-whether-the-current-machine-is-a-laptop-or-desktop
{{- $chassisType := "desktop" }}
{{- if eq .chezmoi.os "darwin" }}
{{- if contains "MacBook" (output "system_profiler" "SPHardwareDataType") }}
{{- $chassisType = "laptop" }}
{{- else }}
{{- $chassisType = "desktop" }}
{{- end }}
{{- else if and (eq .chezmoi.os "linux") (eq (trimAll "\n" (output "sh" "-c" "systemd-detect-virt --container; true")) "none") }}
{{- $chassisType = (output "hostnamectl" "--json=short" | mustFromJson).Chassis }}
{{- else if eq .chezmoi.os "windows" }}
{{- $chassisType = (output "pwsh.exe" "-NoProfile" "-NonInteractive" "-Command" "if ((Get-CimInstance -Class Win32_Battery | Measure-Object).Count -gt 0) { Write-Output 'laptop' } else { Write-Output 'desktop' }") | trim }}
{{- end }}
# https://www.chezmoi.io/user-guide/machines/general/#determine-whether-the-current-machine-is-a-laptop-or-desktop:~:text=Table%20of%20contents-,Determine%20whether%20the%20current%20machine%20is%20a%20laptop%20or%20desktop,-Determine%20how%20many
{{- $cpuCores := 1 }}
{{- $cpuThreads := 1 }}
{{- if eq .chezmoi.os "darwin" }}
{{- $cpuCores = (output "sysctl" "-n" "hw.physicalcpu_max") | trim | atoi }}
{{- $cpuThreads = (output "sysctl" "-n" "hw.logicalcpu_max") | trim | atoi }}
{{- else if and (eq .chezmoi.os "linux") (eq (trimAll "\n" (output "sh" "-c" "systemd-detect-virt --container; true")) "none") }}
{{- $cpuCores = (output "sh" "-c" "lscpu --online --parse | grep --invert-match '^#' | sort --field-separator=',' --key='2,4' --unique | wc --lines") | trim | atoi }}
{{- $cpuThreads = (output "sh" "-c" "lscpu --online --parse | grep --invert-match '^#' | wc --lines") | trim | atoi }}
{{- else if eq .chezmoi.os "windows" }}
{{- $cpuCores = (output "pwsh.exe" "-NoProfile" "-NonInteractive" "-Command" "(Get-CimInstance -ClassName 'Win32_Processor').NumberOfCores") | trim | atoi }}
{{- $cpuThreads = (output "pwsh.exe" "-NoProfile" "-NonInteractive" "-Command" "(Get-CimInstance -ClassName 'Win32_Processor').NumberOfLogicalProcessors") | trim | atoi }}
{{- end }}
encryption = "age"
[age]
identity = "{{ .chezmoi.homeDir }}/key.txt"
recipient = "age14e7wj4lltcvva2jy9vzzul8y7yuj5xk9vtqfxt9erzz58xqwmpjqurdhep"
[git]
autoCommit = true
autoPush = true
commitMessageTemplateFile = ".commit_message.tmpl"
[bitwarden]
unlock = "auto"
[data]
ollamaBase = "https://dingus-server.tail11540.ts.net:11443" # 8 GiB VRAM
{{- if eq .chezmoi.os "android" }}
bash = "/data/data/com.termux/files/usr/bin/bash"
{{- else }}
bash = "/bin/bash"
{{- end }}
useDummySecrets = {{ env "CHEZMOI_USE_DUMMY" | not | not }}
useHeadless = {{ env "CHEZMOI_USE_HEADLESS" | not | not }}
[data.chassis]
type = "{{ $chassisType }}"
cores = {{ $cpuCores }}
threads = {{ $cpuThreads }}