From a50ee7340c75100117abb025844f0df9db02b51b Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Wed, 19 Apr 2023 05:46:43 +0000 Subject: [PATCH] Update 2 files - /home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_20-ensure-user-group.sh.tmpl --- .../run_onchange_after_40-firefox.sh.tmpl | 35 ++++++++++--------- ...change_before_20-ensure-user-group.sh.tmpl | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl index 54d73f00..3686bd3d 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl @@ -252,23 +252,24 @@ for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app {{- if stat (joinPath .host.home ".config" "age" "chezmoi.txt") }} ### Private hosted profile - if [ ! -d "$SETTINGS_DIR/profile.private" ]; then - logg info 'Downloading the encrypted Firefox private profile' - cd "$SETTINGS_DIR" - curl -sSL '{{ .firefoxPrivateProfile }}' -o profile.private.tar.gz.age - logg info 'Decrypting the Firefox private profile' - chezmoi decrypt profile.private.tar.gz.age > profile.private.tar.gz || EXIT_DECRYPT_CODE=$? - if [ -z "$EXIT_DECRYPT_CODE" ]; then - rm -f profile.private.tar.gz.age - logg info 'Decompressing the Firefox private profile' - tar -xzf profile.private.tar.gz - logg success 'The Firefox private profile was successfully installed' - cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/firefox/user.js" "$SETTINGS_DIR/profile.private" - logg info 'Copied ~/.config/firefox/user.js to profile.private profile' - else - logg error 'Failed to decrypt the private Firefox profile' - fi - fi + # Deprecated in favor of using the Restic profile tasks saved in `~/.config/task/Taskfile.yml` + # if [ ! -d "$SETTINGS_DIR/profile.private" ]; then + # logg info 'Downloading the encrypted Firefox private profile' + # cd "$SETTINGS_DIR" + # curl -sSL '{{ .firefoxPrivateProfile }}' -o profile.private.tar.gz.age + # logg info 'Decrypting the Firefox private profile' + # chezmoi decrypt profile.private.tar.gz.age > profile.private.tar.gz || EXIT_DECRYPT_CODE=$? + # if [ -z "$EXIT_DECRYPT_CODE" ]; then + # rm -f profile.private.tar.gz.age + # logg info 'Decompressing the Firefox private profile' + # tar -xzf profile.private.tar.gz + # logg success 'The Firefox private profile was successfully installed' + # cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/firefox/user.js" "$SETTINGS_DIR/profile.private" + # logg info 'Copied ~/.config/firefox/user.js to profile.private profile' + # else + # logg error 'Failed to decrypt the private Firefox profile' + # fi + # fi {{- end }} ### Install Firefox addons (using list declared in .chezmoidata.yaml) diff --git a/home/.chezmoiscripts/universal/run_onchange_before_20-ensure-user-group.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_before_20-ensure-user-group.sh.tmpl index e76eec3b..532cd251 100644 --- a/home/.chezmoiscripts/universal/run_onchange_before_20-ensure-user-group.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_before_20-ensure-user-group.sh.tmpl @@ -1,4 +1,4 @@ -{{- if (ne .host.distro.family "darwin") -}} +{{- if (eq .host.distro.family "darwin") -}} #!/usr/bin/env bash # @file macOS Ensure User Group # @brief Ensures that the provisioning user has a group on the system with the same name