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") }} {{- if stat (joinPath .host.home ".config" "age" "chezmoi.txt") }}
### Private hosted profile ### Private hosted profile
if [ ! -d "$SETTINGS_DIR/profile.private" ]; then # Deprecated in favor of using the Restic profile tasks saved in `~/.config/task/Taskfile.yml`
logg info 'Downloading the encrypted Firefox private profile' # if [ ! -d "$SETTINGS_DIR/profile.private" ]; then
cd "$SETTINGS_DIR" # logg info 'Downloading the encrypted Firefox private profile'
curl -sSL '{{ .firefoxPrivateProfile }}' -o profile.private.tar.gz.age # cd "$SETTINGS_DIR"
logg info 'Decrypting the Firefox private profile' # curl -sSL '{{ .firefoxPrivateProfile }}' -o profile.private.tar.gz.age
chezmoi decrypt profile.private.tar.gz.age > profile.private.tar.gz || EXIT_DECRYPT_CODE=$? # logg info 'Decrypting the Firefox private profile'
if [ -z "$EXIT_DECRYPT_CODE" ]; then # chezmoi decrypt profile.private.tar.gz.age > profile.private.tar.gz || EXIT_DECRYPT_CODE=$?
rm -f profile.private.tar.gz.age # if [ -z "$EXIT_DECRYPT_CODE" ]; then
logg info 'Decompressing the Firefox private profile' # rm -f profile.private.tar.gz.age
tar -xzf profile.private.tar.gz # logg info 'Decompressing the Firefox private profile'
logg success 'The Firefox private profile was successfully installed' # tar -xzf profile.private.tar.gz
cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/firefox/user.js" "$SETTINGS_DIR/profile.private" # logg success 'The Firefox private profile was successfully installed'
logg info 'Copied ~/.config/firefox/user.js to profile.private profile' # cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/firefox/user.js" "$SETTINGS_DIR/profile.private"
else # logg info 'Copied ~/.config/firefox/user.js to profile.private profile'
logg error 'Failed to decrypt the private Firefox profile' # else
fi # logg error 'Failed to decrypt the private Firefox profile'
fi # fi
# fi
{{- end }} {{- end }}
### Install Firefox addons (using list declared in .chezmoidata.yaml) ### 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 #!/usr/bin/env bash
# @file macOS Ensure User Group # @file macOS Ensure User Group
# @brief Ensures that the provisioning user has a group on the system with the same name # @brief Ensures that the provisioning user has a group on the system with the same name