diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml index ec43da49..d12dd6f7 100644 --- a/home/.chezmoidata.yaml +++ b/home/.chezmoidata.yaml @@ -68,7 +68,7 @@ chromeExtensions: - https://chrome.google.com/webstore/detail/web-archives/hkligngkgcpcolhcnkgccglchdafcnao - https://chrome.google.com/webstore/detail/web-vitals/ahfhijdlegdabablpippeagghigmibma firefoxPublicProfile: https://github.com/ProfessorManhattan/firefox-profile-with-plugins.git -firefoxPrivateProfile: +firefoxPrivateProfile: https://public.megabyte.space/profile.private.tar.gz.age firefoxAddOns: - automa - bitwarden-password-manager diff --git a/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl index 765d72c2..072eda0f 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl @@ -177,17 +177,24 @@ for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app git clone {{ .firefoxPublicProfile }} profile.git fi + {{- if and (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 - 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' + 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' + else + logg error 'Failed to decrypt the private Firefox profile' + fi fi + {{- end }} ### Add the populated profiles.ini logg info "Copying "${XDG_DATA_HOME:-$HOME/.local/share}/firefox/profiles.ini" to profile directory" diff --git a/home/dot_local/share/firefox/profiles.ini.tmpl b/home/dot_local/share/firefox/profiles.ini.tmpl index f3d832e7..7fd17af3 100644 --- a/home/dot_local/share/firefox/profiles.ini.tmpl +++ b/home/dot_local/share/firefox/profiles.ini.tmpl @@ -1,17 +1,32 @@ -[Profile3] +[Profile6] +Name=Default (w/ plugins) +IsRelative=1 +Path={{ if eq .host.distro.family "darwin" }}Profiles/{{ end }}profile.plugins + +[Profile5] +Name=Automation +IsRelative=1 +Path={{ if eq .host.distro.family "darwin" }}Profiles/{{ end }}profile.automation + +[Profile4] Name=Development IsRelative=1 Path={{ if eq .host.distro.family "darwin" }}Profiles/{{ end }}profile.development -[Profile2] -Name=Secondary +[Profile3] +Name=Miscellaneous IsRelative=1 -Path={{ if eq .host.distro.family "darwin" }}Profiles/{{ end }}profile.secondary +Path={{ if eq .host.distro.family "darwin" }}Profiles/{{ end }}profile.miscellaneous + +[Profile2] +Name=Private +IsRelative=1 +Path={{ if eq .host.distro.family "darwin" }}Profiles/{{ end }}profile.private [Profile1] -Name=Primary +Name=Git (Public) IsRelative=1 -Path={{ if eq .host.distro.family "darwin" }}Profiles/{{ end }}profile.primary +Path={{ if eq .host.distro.family "darwin" }}Profiles/{{ end }}profile.git Default=1 [Profile0]