-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.chezmoi.toml.tmpl
36 lines (30 loc) · 1.43 KB
/
.chezmoi.toml.tmpl
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
# -*-mode:conf-toml-*- vim:ft=toml
{{- $isServer := false -}}
{{- $manualSetup := false -}}
{{- $shell := "fish" -}}
{{- $chassisType := "desktop" -}}
{{- if eq .chezmoi.os "linux" -}}
{{- $chassisType = (output "hostnamectl" "--json=short" | mustFromJson).Chassis -}}
{{ else if eq .chezmoi.os "windows" -}}
{{- $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 }}
{{- $email := promptStringOnce . "email" "Email" "burgr@posteo.de" -}}
{{- $name := promptStringOnce . "name" "Name" "sb" -}}
{{- $isServer = promptBoolOnce . "isServer" "should this this machine be headless (no GUI?) (y/n)" -}}
{{- $isWorkMachine := promptBoolOnce . "isWorkMachine" "is this a work machine (y/n)" -}}
{{- $manualSetup = promptBoolOnce . "manualSetup" "Do you want to setup this machine manually (no packages installed) (y/n)" -}}
{{if ne .chezmoi.os "linux" -}}
{{ $shell = "pwsh" }}
{{- end}}
[edit]
command = "nvim"
[cd]
command = "{{$shell}}"
[data]
name = "{{ $name }}"
email = "{{ $email }}"
shell = "{{ $shell }}"
isServer = "{{ $isServer }}"
isWorkMachine = "{{ $isWorkMachine }}"
manualSetup = "{{ $manualSetup }}"
chassisType = "{{ $chassisType }}"