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
This commit is contained in:
Brian Zalewski 2023-04-19 05:46:43 +00:00
parent 5f30821078
commit a50ee7340c
2 changed files with 19 additions and 18 deletions

View file

@ -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)

View file

@ -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