2022-11-22 16:52:49 -08:00
|
|
|
{{- $headless := false -}}
|
|
|
|
{{- $ephemeral := false -}}
|
|
|
|
{{- $restricted := false -}}
|
|
|
|
{{- $work := false -}}
|
|
|
|
{{- $ephemeralEnvOrUsername := or (env "CODESPACES") (env "REMOTE_CONTAINERS_IPC") (eq .chezmoi.username "root" "ubuntu" "vagrant" "vscode" "devcontainer") -}}
|
|
|
|
{{- $ephemeralCgroup := and (stat "/proc/1/cgroup") (output "cat" "/proc/1/cgroup" | regexMatch "(docker|lxc)") -}}
|
|
|
|
{{- if or $ephemeralEnvOrUsername $ephemeralCgroup -}}
|
|
|
|
{{- $headless = true -}}
|
|
|
|
{{- $ephemeral = true -}}
|
|
|
|
{{- writeToStdout "Chezmoi is running in a container.\n" -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $toolchains := list "cloud" "docker" "iac" "java" "kubernetes" "node" "python" "rust" "extra" }}
|
|
|
|
{{- $data := . }}
|
|
|
|
{{- $_ := set $data "host" (default (dict) (get $data "host")) -}}
|
|
|
|
{{- $_ := set $data "user" (default (dict) (get $data "user")) -}}
|
|
|
|
{{- $_ := set $data "toolchains" (default (dict) (get $data "toolchains")) -}}
|
|
|
|
|
|
|
|
{{- $distro := dict "family" .chezmoi.os "id" (get .chezmoi.osRelease "id" | default .chezmoi.os) -}}
|
|
|
|
{{- if or (eq $distro.id "arch") (eq $distro.id "archarm") -}}
|
|
|
|
{{- $_ := set $distro "id" "archlinux" -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $chassisType := "desktop" }}
|
|
|
|
{{- if $ephemeral -}}
|
|
|
|
{{- $chassisType = "ephemeral" }}
|
|
|
|
{{- else if eq .chezmoi.os "linux" }}
|
|
|
|
{{- if (.chezmoi.kernel.osrelease | lower | contains "microsoft") -}}
|
|
|
|
{{- $chassisType = "wsl" }}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $chassisType = (output "hostnamectl" "--json=short" | mustFromJson).Chassis }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- else if eq .chezmoi.os "darwin" }}
|
|
|
|
{{- if contains "MacBook" (output "sysctl" "-n" "hw.model") }}
|
|
|
|
{{- $chassisType = "laptop" }}
|
|
|
|
{{- else }}
|
|
|
|
{{- $chassisType = "desktop" }}
|
|
|
|
{{- end }}
|
|
|
|
{{- else if eq .chezmoi.os "windows" }}
|
|
|
|
{{- $chassisType = (output "powershell.exe" "-noprofile" "-command" "if (Get-WmiObject -Class win32_battery -ComputerName localhost) { echo laptop } else { echo desktop }") }}
|
2022-11-21 23:17:51 -08:00
|
|
|
{{- end }}
|
2022-11-22 16:52:49 -08:00
|
|
|
|
|
|
|
{{- $toolchainsEnabled := dict }}
|
|
|
|
{{- range $toolchain := $toolchains }}
|
|
|
|
{{- $withoutToolchains := env "WITHOUT_TOOLCHAINS" -}}
|
|
|
|
{{- $withoutToolchain := env (list "WITHOUT" (upper $toolchain) | join "_") -}}
|
|
|
|
{{- $withToolchain := env (list "WITH" (upper $toolchain) | join "_") -}}
|
|
|
|
{{- if and (or $withoutToolchains $withoutToolchain) (not $withToolchain) -}}
|
|
|
|
{{- writeToStdout (list "Disabled" $toolchain "toolchain.\n" | join " ") -}}
|
|
|
|
{{- $_ := set $toolchainsEnabled $toolchain false }}
|
|
|
|
{{- else }}
|
|
|
|
{{- $_ := set $toolchainsEnabled $toolchain true }}
|
|
|
|
{{- end}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if stdinIsATTY -}}
|
|
|
|
|
2022-11-22 19:42:34 -08:00
|
|
|
{{- $work = promptBoolOnce $data.host "work" "Work environment" $work -}}
|
2022-11-22 16:52:49 -08:00
|
|
|
{{- $restricted = promptBoolOnce $data.host "restricted" "Restricted Environment (no sudo access)" $restricted -}}
|
2022-11-22 19:42:34 -08:00
|
|
|
{{- $name = promptStringOnce $data.user "name" "Your full name" $name -}}
|
|
|
|
{{- $email = promptStringOnce $data.user "email" "Your primary e-mail" $email -}}
|
2022-11-22 16:52:49 -08:00
|
|
|
{{- $gmailAddress := promptStringOnce . "G-mail address" -}}
|
|
|
|
{{- $gmailAddressAppPassword := promptStringOnce . "G-mail app password" -}}
|
|
|
|
{{- $ngrokAuthToken := promptStringOnce . "Ngrok authentication token" -}}
|
|
|
|
{{- $slackApiToken := promptStringOnce . "Slack API token" -}}
|
|
|
|
{{- range $toolchain := $toolchains }}
|
|
|
|
{{- $enabled := promptBoolOnce $data.toolchains $toolchain (list "Enable" $toolchain "toolchain" | join " ") (get $toolchainsEnabled $toolchain) -}}
|
|
|
|
{{- if and (eq $toolchain "kubernetes") $enabled (not $toolchainsEnabled.docker) -}}
|
|
|
|
{{- $_ := set $toolchainsEnabled "docker" $enabled }}
|
|
|
|
{{- writeToStdout "Enabled Docker toolchain to support Kubernetes.\n" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $_ := set $toolchainsEnabled $toolchain $enabled }}
|
|
|
|
{{- end }}
|
|
|
|
{{- writeToStdout "💡 Tip: you can re-enter your name and email with `chezmoi init --data=false`.\n" -}}
|
|
|
|
|
|
|
|
{{- else -}}
|
|
|
|
|
|
|
|
{{- $headless = true -}}
|
|
|
|
{{- writeToStdout "Chezmoi is running in headless environment.\n" -}}
|
|
|
|
|
|
|
|
{{- end -}}
|
|
|
|
|
Update dotfiles/.local/share/chezmoi/.chezmoiexternal.toml, dotfiles/.local/share/chezmoi/.chezmoi.toml.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.tmpl, dotfiles/.local/share/chezmoi/.chezmoiignore, dotfiles/.config/chezmoi/chezmoi.toml, dotfiles/.local/share/chezmoi/dot_gitconfig.tmpl, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.profile, dotfiles/.local/share/chezmoi/.chezmoitemplates/profile.sh, dotfiles/.vimrc, dotfiles/.local/share/chezmoi/.chezmoitemplates/chassis-info, dotfiles/.local/share/chezmoi/.chezmoitemplates/cpu-info, dotfiles/.local/share/chezmoi/run_once_before_install-software.sh.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml
Deleted dotfiles/.config/chezmoi/chezmoi.yaml
2022-11-21 17:06:51 -08:00
|
|
|
sourceDir = {{ .chezmoi.sourceDir | quote }}
|
|
|
|
|
|
|
|
[data]
|
2022-11-22 19:42:34 -08:00
|
|
|
work = {{ $work | quote }}
|
|
|
|
restricted = {{ $restricted | quote }}
|
Update dotfiles/.local/share/chezmoi/.chezmoiexternal.toml, dotfiles/.local/share/chezmoi/.chezmoi.toml.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.tmpl, dotfiles/.local/share/chezmoi/.chezmoiignore, dotfiles/.config/chezmoi/chezmoi.toml, dotfiles/.local/share/chezmoi/dot_gitconfig.tmpl, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.profile, dotfiles/.local/share/chezmoi/.chezmoitemplates/profile.sh, dotfiles/.vimrc, dotfiles/.local/share/chezmoi/.chezmoitemplates/chassis-info, dotfiles/.local/share/chezmoi/.chezmoitemplates/cpu-info, dotfiles/.local/share/chezmoi/run_once_before_install-software.sh.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml
Deleted dotfiles/.config/chezmoi/chezmoi.yaml
2022-11-21 17:06:51 -08:00
|
|
|
codespaces = {{ $codespaces }}
|
|
|
|
headless = {{ $headless }}
|
2022-11-22 16:52:49 -08:00
|
|
|
{{- if $ephemeral }}
|
Update dotfiles/.local/share/chezmoi/.chezmoiexternal.toml, dotfiles/.local/share/chezmoi/.chezmoi.toml.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.tmpl, dotfiles/.local/share/chezmoi/.chezmoiignore, dotfiles/.config/chezmoi/chezmoi.toml, dotfiles/.local/share/chezmoi/dot_gitconfig.tmpl, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.profile, dotfiles/.local/share/chezmoi/.chezmoitemplates/profile.sh, dotfiles/.vimrc, dotfiles/.local/share/chezmoi/.chezmoitemplates/chassis-info, dotfiles/.local/share/chezmoi/.chezmoitemplates/cpu-info, dotfiles/.local/share/chezmoi/run_once_before_install-software.sh.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml
Deleted dotfiles/.config/chezmoi/chezmoi.yaml
2022-11-21 17:06:51 -08:00
|
|
|
email = "help@megabyte.space"
|
2022-11-21 23:17:51 -08:00
|
|
|
gmailAddress = ""
|
|
|
|
gmailAddressAppPassword = ""
|
Update dotfiles/.local/share/chezmoi/.chezmoiexternal.toml, dotfiles/.local/share/chezmoi/.chezmoi.toml.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.tmpl, dotfiles/.local/share/chezmoi/.chezmoiignore, dotfiles/.config/chezmoi/chezmoi.toml, dotfiles/.local/share/chezmoi/dot_gitconfig.tmpl, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.profile, dotfiles/.local/share/chezmoi/.chezmoitemplates/profile.sh, dotfiles/.vimrc, dotfiles/.local/share/chezmoi/.chezmoitemplates/chassis-info, dotfiles/.local/share/chezmoi/.chezmoitemplates/cpu-info, dotfiles/.local/share/chezmoi/run_once_before_install-software.sh.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml
Deleted dotfiles/.config/chezmoi/chezmoi.yaml
2022-11-21 17:06:51 -08:00
|
|
|
name = "Megabyte Labs"
|
|
|
|
{{- else }}
|
|
|
|
email = {{ $email | quote }}
|
2022-11-21 23:17:51 -08:00
|
|
|
gmailAddress = {{ $gmailAddress | quote }}
|
|
|
|
gmailAddressAppPassword = {{ $gmailAddressAppPassword | quote }}
|
Update dotfiles/.local/share/chezmoi/.chezmoiexternal.toml, dotfiles/.local/share/chezmoi/.chezmoi.toml.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.tmpl, dotfiles/.local/share/chezmoi/.chezmoiignore, dotfiles/.config/chezmoi/chezmoi.toml, dotfiles/.local/share/chezmoi/dot_gitconfig.tmpl, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.profile, dotfiles/.local/share/chezmoi/.chezmoitemplates/profile.sh, dotfiles/.vimrc, dotfiles/.local/share/chezmoi/.chezmoitemplates/chassis-info, dotfiles/.local/share/chezmoi/.chezmoitemplates/cpu-info, dotfiles/.local/share/chezmoi/run_once_before_install-software.sh.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml
Deleted dotfiles/.config/chezmoi/chezmoi.yaml
2022-11-21 17:06:51 -08:00
|
|
|
name = {{ $name | quote }}
|
2022-11-22 19:42:34 -08:00
|
|
|
DOCKERHUB_TOKEN =
|
Update dotfiles/.local/share/chezmoi/run_once_provision, dotfiles/.local/share/chezmoi/.chezmoidata.yaml, dotfiles/.local/share/chezmoi/home/private_dot_config/slack-term/config.tmpl, dotfiles/.local/share/chezmoi/.chezmoi.toml.tmpl, dotfiles/.local/share/chezmoi/home/private_dot_config/ngrok/ngrok.yml.tmpl, dotfiles/.local/share/chezmoi/home/private_dot_config/ghorg/conf.yaml.tmpl, dotfiles/.local/share/chezmoi/home/private_dot_config/himalaya/config.toml.tmpl.TODO, dotfiles/.local/share/chezmoi/home/private_dot_config/npm/npmrc.tmpl.TODO, dotfiles/.local/share/chezmoi/home/private_dot_config/powershell/user_profile.ps1.TODO, dotfiles/.local/share/chezmoi/home/private_dot_config/rofi/config.rasi.tmpl.TODO, dotfiles/.local/share/chezmoi/home/private_dot_config/tabby/config.yaml.tmpl
Deleted dotfiles/.local/share/chezmoi/home/private_dot_config/tabby/package-lock.json
2022-11-22 14:39:17 -08:00
|
|
|
GITHUB_TOKEN = {{ $githubToken | quote }}
|
|
|
|
GITLAB_TOKEN = {{ $gitlabToken | quote }}
|
|
|
|
NGROK_AUTH_TOKEN = {{ $ngrokAuthToken | quote }}
|
|
|
|
SLACK_API_TOKEN = {{ $slackApiToken | quote }}
|
|
|
|
TABBY_SYNC_TOKEN = "196a3118cc7be31cd13d2862d7e33c122357fd9fa36c2f149e8b018b82c260ab6b72169f4c411a6bedd2b8b4124c3540daa57778f20a28cfe2c797776f9a616c"
|
2022-11-22 19:42:34 -08:00
|
|
|
VAGRANT_CLOUD_TOKEN =
|
Update dotfiles/.local/share/chezmoi/.chezmoiexternal.toml, dotfiles/.local/share/chezmoi/.chezmoi.toml.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.tmpl, dotfiles/.local/share/chezmoi/.chezmoiignore, dotfiles/.config/chezmoi/chezmoi.toml, dotfiles/.local/share/chezmoi/dot_gitconfig.tmpl, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.profile, dotfiles/.local/share/chezmoi/.chezmoitemplates/profile.sh, dotfiles/.vimrc, dotfiles/.local/share/chezmoi/.chezmoitemplates/chassis-info, dotfiles/.local/share/chezmoi/.chezmoitemplates/cpu-info, dotfiles/.local/share/chezmoi/run_once_before_install-software.sh.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml
Deleted dotfiles/.config/chezmoi/chezmoi.yaml
2022-11-21 17:06:51 -08:00
|
|
|
{{- end }}
|
|
|
|
|
Update dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/keybindings.json, dotfiles/.local/share/chezmoi/private_dot_config/direnv/direnv.toml, dotfiles/.local/share/chezmoi/private_dot_config/firejail/code.local, dotfiles/.local/share/chezmoi/private_dot_config/firejail/chromium.local, dotfiles/.local/share/chezmoi/private_dot_config/firejail/bitwarden.local, dotfiles/.local/share/chezmoi/private_dot_config/firejail/gcloud.local, dotfiles/.local/share/chezmoi/private_dot_config/firejail/google-chrome-stable.local, dotfiles/.local/share/chezmoi/private_dot_config/firejail/slack.local, dotfiles/.local/share/chezmoi/private_dot_config/firejail/thunderbird.local, dotfiles/.local/share/chezmoi/private_dot_config/git/config.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/git/attributes, dotfiles/.local/share/chezmoi/.chezmoi.toml.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml, dotfiles/.local/share/chezmoi/dot_local/bin/executable_slack, dotfiles/.local/share/chezmoi/dot_local/bin/executable_fonttest, dotfiles/.local/share/chezmoi/dot_local/bin/executable_bwc, dotfiles/.local/share/chezmoi/private_dot_config/rofi/config.rasi.tmpl
2022-11-22 03:27:37 -08:00
|
|
|
[diff]
|
|
|
|
format = "git"
|
|
|
|
pager = "delta"
|
|
|
|
|
Update dotfiles/.local/share/chezmoi/.chezmoiexternal.toml, dotfiles/.local/share/chezmoi/.chezmoi.toml.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.tmpl, dotfiles/.local/share/chezmoi/.chezmoiignore, dotfiles/.config/chezmoi/chezmoi.toml, dotfiles/.local/share/chezmoi/dot_gitconfig.tmpl, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.profile, dotfiles/.local/share/chezmoi/.chezmoitemplates/profile.sh, dotfiles/.vimrc, dotfiles/.local/share/chezmoi/.chezmoitemplates/chassis-info, dotfiles/.local/share/chezmoi/.chezmoitemplates/cpu-info, dotfiles/.local/share/chezmoi/run_once_before_install-software.sh.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml
Deleted dotfiles/.config/chezmoi/chezmoi.yaml
2022-11-21 17:06:51 -08:00
|
|
|
[git]
|
|
|
|
autoCommit = true
|
|
|
|
autoPush = true
|