From 97dc9b86b4f11f7694ddf3caf64bb6b940f3724c Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Fri, 2 Dec 2022 06:36:57 +0000 Subject: [PATCH] Update .local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_after_set-wallpaper.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_1-decrypt-age-key.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_10_install-aqua-packages.sh.tmpl, .local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl, .local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl, .local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_50-crontab.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-zsh-plugins.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_before_5-install-homebrew.tmpl, .local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages.tmpl --- ...efore_10_install-archlinux-dependencies.tmpl | 2 ++ ...e_before_10-install-centos-dependencies.tmpl | 2 ++ .../run_onchange_after_set-wallpaper.tmpl | 10 ++++++++++ ...e_before_10_install-darwin-dependencies.tmpl | 2 ++ ...e_before_10-install-debian-dependencies.tmpl | 2 ++ ...e_before_10-install-fedora-dependencies.tmpl | 2 ++ ...ange_before_11-install-freebsd-packages.tmpl | 2 ++ ...nge_before_11-install-opensuse-software.tmpl | 2 ++ ...e_before_10_install-ubuntu-dependencies.tmpl | 2 ++ .../run_once_before_1-decrypt-age-key.tmpl | 17 +++++++++++++++++ .../run_once_before_decrypt-age-key.tmpl | 15 --------------- ...hange_after_10_install-aqua-packages.sh.tmpl | 6 +++--- .../run_onchange_after_50-crontab.tmpl | 2 +- .../run_onchange_after_80-bash-completions.tmpl | 3 ++- .../run_onchange_after_99_bootstrap-z4h.tmpl | 11 ----------- ...onchange_after_99_bootstrap-zsh-plugins.tmpl | 14 ++++++++++++++ .../run_onchange_before_5-install-homebrew.tmpl | 2 +- ...ange_before_11-install-windows-packages.tmpl | 2 -- 18 files changed, 64 insertions(+), 34 deletions(-) create mode 100644 .local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_after_set-wallpaper.tmpl create mode 100644 .local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_1-decrypt-age-key.tmpl delete mode 100644 .local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_decrypt-age-key.tmpl delete mode 100644 .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-z4h.tmpl create mode 100644 .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-zsh-plugins.tmpl diff --git a/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl index 3a6116d6..ac7dae47 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# universal/essential-packages hash: {{ include (joinPath ".chezmoitemplates" "universal" "essential-packages") | sha256sum }} + {{- includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl index cc03d181..55e45711 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# universal/essential-packages hash: {{ include (joinPath ".chezmoitemplates" "universal" "essential-packages") | sha256sum }} + {{- includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_after_set-wallpaper.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_after_set-wallpaper.tmpl new file mode 100644 index 00000000..95656d7d --- /dev/null +++ b/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_after_set-wallpaper.tmpl @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Betelgeuse-macOS wallpaper hash: {{ include (joinPath .chezmoi.homeDir ".local" "src" "betelgeuse" "share" "wallpapers" "Betelgeuse-macOS" "contents" "source.png") | sha256sum }} + +### Set macOS wallpaper +if command -v m > /dev/null && [ -f "$HOME/.local/src/betelgeuse/share/wallpapers/Betelgeuse-macOS/contents/source.png" ]; then + m wallpaper "$HOME/.local/src/betelgeuse/share/wallpapers/Betelgeuse-macOS/contents/source.png" +else + logg warn 'Either `m` or the macOS default wallpaper is missing.' +fi diff --git a/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl index d416464a..2a605c39 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# darwin/Brewfile hash: {{ include (joinPath ".chezmoitemplates" "darwin" "Brewfile") | sha256sum }} + {{- includeTemplate "universal/profile" }} {{- includeTemplate "universal/logg" }} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl index bb1aa5d2..0e2bd2ea 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# universal/essential-packages hash: {{ include (joinPath ".chezmoitemplates" "universal" "essential-packages") | sha256sum }} + {{- includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) -}} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl index cc03d181..55e45711 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# universal/essential-packages hash: {{ include (joinPath ".chezmoitemplates" "universal" "essential-packages") | sha256sum }} + {{- includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl index d5751bc3..7fac7b91 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# universal/essential-packages hash: {{ include (joinPath ".chezmoitemplates" "universal" "essential-packages") | sha256sum }} + {{- includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl index 943d306c..cffead5a 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# universal/essential-packages hash: {{ include (joinPath ".chezmoitemplates" "universal" "essential-packages") | sha256sum }} + {{- includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl index ef13699b..13b2c5a6 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# universal/essential-packages hash: {{ include (joinPath ".chezmoitemplates" "universal" "essential-packages") | sha256sum }} + {{- includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) -}} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_1-decrypt-age-key.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_1-decrypt-age-key.tmpl new file mode 100644 index 00000000..10f6fe13 --- /dev/null +++ b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_1-decrypt-age-key.tmpl @@ -0,0 +1,17 @@ +#!/bin/sh + +{{- includeTemplate "universal/logg" }} + +XDG_CONFIG_HOME="$HOME/.config" + +if [ ! -f "${XDG_CONFIG_HOME}/age/chezmoi.txt" ]; then + mkdir -p "${XDG_CONFIG_HOME}/age" + logg star '`PRESS ENTER` if you have not set up your encryption token yet' + age --decrypt --output "${XDG_CONFIG_HOME}/age/chezmoi.txt" "{{ .chezmoi.sourceDir }}/key.txt.age" || EXIT_CODE=$? + if [ -n "$EXIT_CODE" ]; then + logg info 'Proceeding without decrypting age encryption key stored at `~/.local/share/chezmoi/home/key.txt.age`' + logg info 'To have Chezmoi handle your encryption (so you can store your private files publicly) take a look at https://www.chezmoi.io/user-guide/frequently-asked-questions/encryption/#how-do-i-configure-chezmoi-to-encrypt-files-but-only-request-a-passphrase-the-first-time-chezmoi-init-is-run' + else + chmod 600 "${XDG_CONFIG_HOME}/age/chezmoi.txt" + fi +fi diff --git a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_decrypt-age-key.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_decrypt-age-key.tmpl deleted file mode 100644 index aec14394..00000000 --- a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_decrypt-age-key.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -XDG_CONFIG_HOME="$HOME/.config" - -if [ ! -f "${XDG_CONFIG_HOME}/age/chezmoi.txt" ]; then - mkdir -p "${XDG_CONFIG_HOME}/age" - echo "PRESS ENTER if you have not set up your encryption token yet" - age --decrypt --output "${XDG_CONFIG_HOME}/age/chezmoi.txt" "{{ .chezmoi.sourceDir }}/key.txt.age" || EXIT_CODE=$? - if [ -n "$EXIT_CODE" ]; then - echo "Proceeding without decrypting age encryption key stored at ~/.local/share/chezmoi/home/key.txt.age" - echo "To have Chezmoi handle your encryption (so you can store your private files publicly) take a look at https://www.chezmoi.io/user-guide/frequently-asked-questions/encryption/#how-do-i-configure-chezmoi-to-encrypt-files-but-only-request-a-passphrase-the-first-time-chezmoi-init-is-run" - else - chmod 600 "${XDG_CONFIG_HOME}/age/chezmoi.txt" - fi -fi diff --git a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_10_install-aqua-packages.sh.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_10_install-aqua-packages.sh.tmpl index d0c6ad28..837f9eae 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_10_install-aqua-packages.sh.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_10_install-aqua-packages.sh.tmpl @@ -12,12 +12,12 @@ set -eufo pipefail {{- end }} # aqua.yaml.tmpl hash: {{ $files | join "" | sha256sum }} if ! command -v aqua >/dev/null 2>&1; then - logg 'Installing Aqua' + logg info 'Installing Aqua' curl -sSfL https://raw.githubusercontent.com/aquaproj/aqua-installer/v1.0.0/aqua-installer | bash fi -logg 'Updating Aqua' +logg info 'Updating Aqua' aqua update-aqua -logg 'Installing Aqua dependencies (if any are defined)' +logg info 'Installing Aqua dependencies (if any are defined)' aqua install -a {{- end }} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_50-crontab.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_50-crontab.tmpl index 7bf44622..6e545599 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_50-crontab.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_50-crontab.tmpl @@ -1,7 +1,7 @@ #!/usr/bin/env sh {{- if false }} -# {{ output "sha256sum" (joinPath .chezmoi.sourceDir "private_dot_config/crontab/config") }} +# crontab config hash: {{ include (joinPath .chezmoi.homeDir ".config" "crontab" "config")| sha256sum }} {{- includeTemplate "universal/profile" }} {{- includeTemplate "universal/logg" }} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.tmpl index 37692eb0..b37d8975 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.tmpl @@ -1,6 +1,7 @@ #!/usr/bin/env bash -# {{ output "sha256sum" (joinPath .chezmoi.sourceDir ".chezmoidata.yaml") }} +# .chezmoidata.yml hash: {{ include (joinPath .chezmoi.sourceDir ".chezmoidata.yml")| sha256sum }} +# software.yml hash: {{ include (joinPath .chezmoi.homeDir ".local" "share" "chezmoi" "software.yml")| sha256sum }} {{- includeTemplate "universal/profile" }} {{- includeTemplate "universal/logg" }} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-z4h.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-z4h.tmpl deleted file mode 100644 index 45f1001b..00000000 --- a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-z4h.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -{{- if and false .host.headless -}} - -{{- includeTemplate "universal/profile" }} -{{- includeTemplate "universal/logg" }} - -logg 'Bootstrapping Z4H' - -Z4H_BOOTSTRAPPING=1 exec zsh && exit 0 -{{- end }} -# TODO diff --git a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-zsh-plugins.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-zsh-plugins.tmpl new file mode 100644 index 00000000..ce7469eb --- /dev/null +++ b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-zsh-plugins.tmpl @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +{{- if .host.headless }} + +# .zshrc hash: {{ include (joinPath .chezmoi.homeDir ".zshrc")| sha256sum }} + +{{- includeTemplate "universal/profile" }} +{{- includeTemplate "universal/logg" }} + +### Initialize ZSH so plugin bootstrap process is done ahead of time +if command -v zsh > /dev/null; then + logg 'Bootstrapping ZSH plugin system' + exec zsh && exit 0 +fi +{{- end -}} diff --git a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_before_5-install-homebrew.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_before_5-install-homebrew.tmpl index be1a9130..6ec672aa 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_before_5-install-homebrew.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_before_5-install-homebrew.tmpl @@ -5,7 +5,7 @@ ### Install Xcode CLI tools on macOS if [ -d /Applications ] && [ -d /Library ]; then - xcode-select -p >/dev/null 2>&1 || xcode-select --install + xcode-select -p >/dev/null 2>&1 || sudo xcode-select --install fi ### Install Homebrew diff --git a/.local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages.tmpl b/.local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages.tmpl index 2b54d9ad..0eec2b4a 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages.tmpl +++ b/.local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages.tmpl @@ -1,5 +1,3 @@ #!/usr/bin/env bash {{- if eq .host.distro.id "windows" }} - - {{- end }}