nixos/home/scripts/git-sync-all.sh
Evie Litherland-Smith 4c7cdbeb8e Add bookmarks.org and export steps to nix config
Move bookmarks.org into this repo and use runCommand to call emacs
org-html-export-to-html, set output file as firefox homepage

Remove bookmarks from git-sync-all.sh

Disable firefox SanitizeOnShutdown so that I can keep pinned tabs
between sessions
2024-04-08 14:25:04 +01:00

54 lines
1.4 KiB
Bash
Executable file

# Sync common directories, setting url to ensure it's up-to-date first
SYNC_DIRS=(
"$HOME/.password-store/"
"$HOME/.diary/"
"$HOME/.elfeed/"
"$HOME/Documents/Org/"
"$HOME/Documents/References/"
)
SYNC_URLS=(
"https://git.xenia.me.uk/pixelifytica/pass.git"
"https://git.xenia.me.uk/pixelifytica/diary.git"
"https://git.xenia.me.uk/pixelifytica/elfeed.git"
"https://git.xenia.me.uk/pixelifytica/org.git"
"https://git.xenia.me.uk/pixelifytica/references.git"
)
for i in "${!SYNC_DIRS[@]}"; do
DIRECTORY="${SYNC_DIRS[$i]}"
URL="${SYNC_URLS[$i]}"
echo "--- sync: $DIRECTORY ---"
if [ ! -d "$DIRECTORY" ]; then
git clone "$URL" "$DIRECTORY"
fi
(
cd "$DIRECTORY" || exit
git remote set-url origin "$URL"
git-sync -ns
)
done
# Pull NixOS and Emacs config if simple fast-forward
PULL_DIRS=(
"/etc/nixos"
"${XDG_CONFIG_HOME:-$HOME/.config}/emacs"
)
PULL_URLS=(
"https://git.xenia.me.uk/pixelifytica/nixos.git"
"https://git.xenia.me.uk/pixelifytica/emacs.git"
)
for i in "${!PULL_DIRS[@]}"; do
DIRECTORY="${PULL_DIRS[$i]}"
URL="${PULL_URLS[$i]}"
echo "--- pull: $DIRECTORY ---"
if [ ! -d "$DIRECTORY" ]; then
git clone "$URL" "$DIRECTORY"
fi
(
cd "$DIRECTORY" || exit
git remote set-url origin "$URL"
git pull --ff-only
git push
)
done