Compare commits
No commits in common. "03a2310480352b0dd05969c7330f4c0a2677c9da" and "c34f7ae6312da5a401b47e035e7daf92d436b7dd" have entirely different histories.
03a2310480
...
c34f7ae631
261 changed files with 376 additions and 690 deletions
|
@ -3,36 +3,28 @@
|
||||||
# which of the _home.* dirs will be set as the .chezmoiroot
|
# which of the _home.* dirs will be set as the .chezmoiroot
|
||||||
#
|
#
|
||||||
|
|
||||||
{{- $githubToken := promptStringOnce . "githubToken" "Public GITHUB token (mostly for rate limits - !insecure!)" (or (
|
{{- $githubToken := or (env "CHEZMOI_GITHUB_ACCESS_TOKEN") (env "GITHUB_ACCESS_TOKEN") (env "GITHUB_TOKEN") }}
|
||||||
env "CZ_GITHUB_ACCESS_TOKEN"
|
{{- if not ($githubToken) }}
|
||||||
) ( env "CHEZMOI_GITHUB_ACCESS_TOKEN"
|
{{- $githubToken = promptStringOnce . "githubToken" "Public GITHUB token (mostly for rate limits - !insecure!)" }}
|
||||||
) ( env "GITHUB_ACCESS_TOKEN"
|
{{- end }}
|
||||||
) ( env "GITHUB_TOKEN"
|
|
||||||
)) -}}
|
|
||||||
{{- $scriptTempDir := "~/.cache/chezmoi/tmp" }}
|
{{- $scriptTempDir := "~/.cache/chezmoi/tmp" }}
|
||||||
|
|
||||||
{{- $chassisType := "desktop" }}
|
{{- $chassisType := "desktop" }}
|
||||||
{{- $sysType := "posix" }}
|
{{- $sysType := "posix" }}
|
||||||
{{- $sysVendor := "unknown" }}
|
{{- $sysVendor := "unknown" }}
|
||||||
{{- if eq .chezmoi.os "darwin" }}
|
{{- if eq .chezmoi.os "darwin" }}
|
||||||
{{- $sysType = "macos" }}
|
{{- $sysType = "macos" }}
|
||||||
{{- $sysVendor = "apple" }}
|
|
||||||
{{- if contains "BatteryData" (output "ioreg" "-c" "AppleSmartBattery") }}
|
{{- if contains "BatteryData" (output "ioreg" "-c" "AppleSmartBattery") }}
|
||||||
{{- $chassisType = "laptop" }}
|
{{- $chassisType = "laptop" }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- $chassisType = "desktop" }}
|
{{- $chassisType = "desktop" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else if eq .chezmoi.os "linux" }}
|
{{- else if eq .chezmoi.os "linux" }}
|
||||||
{{- $chassisType = or (and
|
# $chassisType = (output "hostnamectl" "--json=short" | mustFromJson).Chassis }}
|
||||||
(lookPath "hostnamectl") (output "hostnamectl" "--json=short" | mustFromJson).Chassis
|
{{- $chassisType = "server" }}
|
||||||
)
|
|
||||||
"server"
|
|
||||||
}}
|
|
||||||
{{- else if eq .chezmoi.os "windows" }}
|
{{- else if eq .chezmoi.os "windows" }}
|
||||||
{{- $sysType = "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 }}
|
{{- $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 }}
|
scriptTempDir={{- $scriptTempDir | quote }}
|
||||||
|
|
||||||
|
@ -42,5 +34,3 @@ scriptTempDir={{- $scriptTempDir | quote }}
|
||||||
CZ_SYS={{- $sysType | quote }}
|
CZ_SYS={{- $sysType | quote }}
|
||||||
CZ_OS={{- .chezmoi.os | quote }}
|
CZ_OS={{- .chezmoi.os | quote }}
|
||||||
CZ_GITHUB_ACCESS_TOKEN={{- $githubToken | quote }}
|
CZ_GITHUB_ACCESS_TOKEN={{- $githubToken | quote }}
|
||||||
CZ_VENDOR={{- $sysVendor | quote }}
|
|
||||||
|
|
||||||
|
|
|
@ -2,19 +2,18 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
[ -z "$SET_X" ] || env | grep -E 'chezmoi|^CZ'
|
env | grep -E 'chezmoi|^CZ'
|
||||||
cd "$CHEZMOI_SOURCE_DIR"
|
cd "$CHEZMOI_SOURCE_DIR"
|
||||||
#CZ_MODEL="$(ioreg -l | grep "product-name" | sed -Ee 's/^.*\<"(.*)\"\>.*$/\1/')"
|
#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"
|
printf 'System detected as %s/%s, setting up .chezmoiroot and initializing...\n' "$CZ_SYS" "$CZ_CHASSIS"
|
||||||
${SET_X:-:} -x
|
set -x
|
||||||
CZROOTLINK=chezmoi.roots/__root_links/base.chezmoiroot
|
if [ -r "base.chezmoiroot.$CZ_SYS.$CZ_CHASSIS" ]; then
|
||||||
if [ -r "${CZROOTLINK}.$CZ_SYS.$CZ_CHASSIS" ]; then
|
ln -s "base.chezmoiroot.$CZ_SYS.$CZ_CHASSIS" .chezmoiroot
|
||||||
ln -s "${CZROOTLINK}.$CZ_SYS.$CZ_CHASSIS" .chezmoiroot
|
elif [ -r "base.chezmoiroot.$CZ_SYS" ]; then
|
||||||
elif [ -r "${CZROOTLINK}.$CZ_SYS" ]; then
|
ln -s "base.chezmoiroot.$CZ_SYS" .chezmoiroot
|
||||||
ln -s "${CZROOTLINK}.$CZ_SYS" .chezmoiroot
|
elif [ -r "base.chezmoiroot.$CZ_CHASSIS" ]; then
|
||||||
elif [ -r "${CZROOTLINK}.$CZ_CHASSIS" ]; then
|
ln -s "base.chezmoiroot.$CZ_CHASSIS" .chezmoiroot
|
||||||
ln -s "${CZROOTLINK}.$CZ_CHASSIS" .chezmoiroot
|
|
||||||
else
|
else
|
||||||
printf 'Failed to find a matching .chezmoiroot. Aborting!\n'
|
printf 'Failed to find a matching .chezmoiroot. Aborting!\n'
|
||||||
false
|
false
|
||||||
|
|
37
.init.me.sh
37
.init.me.sh
|
@ -1,39 +1,6 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
CZ_DEBUG=
|
set -ex
|
||||||
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
|
|
||||||
|
|
||||||
rm -fR ~/.config/chezmoi ~/.local/share/chezmoi/.chezmoiroot
|
rm -fR ~/.config/chezmoi ~/.local/share/chezmoi/.chezmoiroot
|
||||||
chezmoi init ${CZ_DEBUG} --apply
|
chezmoi init --apply
|
||||||
unset SET_X
|
|
||||||
|
|
1
_home.macos/private_dot_config/sz.env/.aliases.macos.env
Symbolic link
1
_home.macos/private_dot_config/sz.env/.aliases.macos.env
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../../_src.posix/private_dot_config/sz.env/.aliases.macos.env
|
1
_home.macos/private_dot_config/sz.env/zza_atuin.env
Symbolic link
1
_home.macos/private_dot_config/sz.env/zza_atuin.env
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../../_src.posix/private_dot_config/sz.env/zza_atuin.env
|
1
_home.macos/private_dot_config/sz.env/zzz_chezmoi.env.tmpl
Symbolic link
1
_home.macos/private_dot_config/sz.env/zzz_chezmoi.env.tmpl
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../../_src.posix/private_dot_config/sz.env/zzz_chezmoi.env.tmpl
|
1
_home.macos/private_dot_config/sz.env/zzz_fzf.env.off
Symbolic link
1
_home.macos/private_dot_config/sz.env/zzz_fzf.env.off
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../../_src.posix/private_dot_config/sz.env/zzz_fzf.env.off
|
1
_home.macos/private_dot_config/wezterm/wezterm.lua
Symbolic link
1
_home.macos/private_dot_config/wezterm/wezterm.lua
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../../_src.all/private_dot_config/wezterm/wezterm.lua
|
1
_home/private_dot_config/sz.env/.aliases.macos.env
Symbolic link
1
_home/private_dot_config/sz.env/.aliases.macos.env
Symbolic link
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue