Compare commits

..

No commits in common. "03a2310480352b0dd05969c7330f4c0a2677c9da" and "c34f7ae6312da5a401b47e035e7daf92d436b7dd" have entirely different histories.

261 changed files with 376 additions and 690 deletions

View file

@ -3,36 +3,28 @@
# which of the _home.* dirs will be set as the .chezmoiroot
#
{{- $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"
)) -}}
{{- $githubToken := or (env "CHEZMOI_GITHUB_ACCESS_TOKEN") (env "GITHUB_ACCESS_TOKEN") (env "GITHUB_TOKEN") }}
{{- if not ($githubToken) }}
{{- $githubToken = promptStringOnce . "githubToken" "Public GITHUB token (mostly for rate limits - !insecure!)" }}
{{- end }}
{{- $scriptTempDir := "~/.cache/chezmoi/tmp" }}
{{- $chassisType := "desktop" }}
{{- $sysType := "posix" }}
{{- $sysVendor := "unknown" }}
{{- if eq .chezmoi.os "darwin" }}
{{- $sysType = "macos" }}
{{- $sysVendor = "apple" }}
{{- if contains "BatteryData" (output "ioreg" "-c" "AppleSmartBattery") }}
{{- $chassisType = "laptop" }}
{{- else }}
{{- $chassisType = "desktop" }}
{{- end }}
{{- else if eq .chezmoi.os "linux" }}
{{- $chassisType = or (and
(lookPath "hostnamectl") (output "hostnamectl" "--json=short" | mustFromJson).Chassis
)
"server"
}}
# $chassisType = (output "hostnamectl" "--json=short" | mustFromJson).Chassis }}
{{- $chassisType = "server" }}
{{- else if eq .chezmoi.os "windows" }}
{{- $sysType = "windows" }}
{{- $sysVendor = "pc" }}
{{- $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 }}
{{- end -}}
scriptTempDir={{- $scriptTempDir | quote }}
@ -42,5 +34,3 @@ scriptTempDir={{- $scriptTempDir | quote }}
CZ_SYS={{- $sysType | quote }}
CZ_OS={{- .chezmoi.os | quote }}
CZ_GITHUB_ACCESS_TOKEN={{- $githubToken | quote }}
CZ_VENDOR={{- $sysVendor | quote }}

View file

@ -2,19 +2,18 @@
set -e
[ -z "$SET_X" ] || env | grep -E 'chezmoi|^CZ'
env | grep -E 'chezmoi|^CZ'
cd "$CHEZMOI_SOURCE_DIR"
#CZ_MODEL="$(ioreg -l | grep "product-name" | sed -Ee 's/^.*\<"(.*)\"\>.*$/\1/')"
${SET_X:-:} | grep '^CZ_' || true
set | grep '^CZ_'
printf 'System detected as %s/%s, setting up .chezmoiroot and initializing...\n' "$CZ_SYS" "$CZ_CHASSIS"
${SET_X:-:} -x
CZROOTLINK=chezmoi.roots/__root_links/base.chezmoiroot
if [ -r "${CZROOTLINK}.$CZ_SYS.$CZ_CHASSIS" ]; then
ln -s "${CZROOTLINK}.$CZ_SYS.$CZ_CHASSIS" .chezmoiroot
elif [ -r "${CZROOTLINK}.$CZ_SYS" ]; then
ln -s "${CZROOTLINK}.$CZ_SYS" .chezmoiroot
elif [ -r "${CZROOTLINK}.$CZ_CHASSIS" ]; then
ln -s "${CZROOTLINK}.$CZ_CHASSIS" .chezmoiroot
set -x
if [ -r "base.chezmoiroot.$CZ_SYS.$CZ_CHASSIS" ]; then
ln -s "base.chezmoiroot.$CZ_SYS.$CZ_CHASSIS" .chezmoiroot
elif [ -r "base.chezmoiroot.$CZ_SYS" ]; then
ln -s "base.chezmoiroot.$CZ_SYS" .chezmoiroot
elif [ -r "base.chezmoiroot.$CZ_CHASSIS" ]; then
ln -s "base.chezmoiroot.$CZ_CHASSIS" .chezmoiroot
else
printf 'Failed to find a matching .chezmoiroot. Aborting!\n'
false

View file

@ -1,39 +1,6 @@
#! /usr/bin/env bash
CZ_DEBUG=
while true; do
case "$1" in
--init) break;;
--debug) [[ -z "$SET_X" ]] && export SET_X=set || CZ_DEBUG=--debug;;
*) printf '%s\n' \
'Re-initialize chezmoi based environment, reloading it from source' \
'' \
'Usage:' \
" ${0##*/} [--init]" \
'' \
'Arguments:' \
' without any (or unknown) arguments, displays this usage message.' \
'' \
' --init Perform initialization' \
'' \
'Description:' \
' Deletes ~/.config/chezmoi and the .chezmoiroot and performs' \
' chezmoi init --apply' \
' This, in effect, will trigger .chezmoiscripts/run_init.sh template' \
'' \
' the init script template determins the type of OS and hardware we are' \
' running on and assigns (creates a symlink) the proper root to' \
' .chezmoiroot at which point, it re-initializes the local chezmoi' \
''
exit 2
;;
esac
shift
done
set -e
${SET_X:-:} -x
set -ex
rm -fR ~/.config/chezmoi ~/.local/share/chezmoi/.chezmoiroot
chezmoi init ${CZ_DEBUG} --apply
unset SET_X
chezmoi init --apply

View file

@ -0,0 +1 @@
../../../_src.posix/private_dot_config/sz.env/.aliases.macos.env

View file

@ -0,0 +1 @@
../../../_src.posix/private_dot_config/sz.env/zza_atuin.env

View file

@ -0,0 +1 @@
../../../_src.posix/private_dot_config/sz.env/zzz_chezmoi.env.tmpl

View file

@ -0,0 +1 @@
../../../_src.posix/private_dot_config/sz.env/zzz_fzf.env.off

View file

@ -0,0 +1 @@
../../../_src.all/private_dot_config/wezterm/wezterm.lua

View file

@ -0,0 +1 @@
../../../_src.posix/private_dot_config/sz.env/.aliases.macos.env

Some files were not shown because too many files have changed in this diff Show more