Move contents of sync-emacs into sync-git

This commit is contained in:
Evie Litherland-Smith 2024-12-24 08:24:31 +00:00
parent 6077814878
commit 2298a9264f
4 changed files with 15 additions and 12 deletions

View file

@ -2,7 +2,6 @@
{
home.packages = [
(pkgs.writeShellScriptBin "sync-git" (builtins.readFile ./shell/sync-git.sh))
(pkgs.writeShellScriptBin "sync-emacs" (builtins.readFile ./shell/sync-emacs.sh))
(pkgs.writeShellScriptBin "ensure-pass" (builtins.readFile ./shell/ensure-pass.sh))
(pkgs.writeShellScriptBin "clean-config" (builtins.readFile ./shell/clean-config.sh))
(pkgs.writeShellScriptBin "rsync-local-config" (builtins.readFile ./shell/rsync-local-config.sh))

View file

@ -1,10 +0,0 @@
# Clone ~/.config/emacs/ if it doesn't exist
EMACS_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/emacs"
if [ -d "$EMACS_DIR" ]; then
git -C "$EMACS_DIR" pull --ff --ff-only
else
git clone "https://git.xenia.me.uk/pixelifytica/emacs.git" "$EMACS_DIR"
fi
# Cleanup legacy Emacs config file/directory
[ -f "$HOME/.emacs" ] && rm "$HOME/.emacs"
[ -d "$HOME/.emacs.d" ] && rm -r "$HOME/.emacs.d"

View file

@ -29,3 +29,17 @@ for i in "${!SYNC_DIRS[@]}"; do
git status --porcelain
)
done
# Clone ~/.config/emacs/ if it doesn't exist, pull otherwise
EMACS_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/emacs"
EMACS_URL="https://git.xenia.me.uk/pixelifytica/emacs.git"
if [ -d "$EMACS_DIR" ]; then
git -C "$EMACS_DIR" remote set-url origin "$EMACS_URL"
git -C "$EMACS_DIR" pull --ff --ff-only
else
git clone "$EMACS_URL" "$EMACS_DIR"
fi
# Cleanup legacy Emacs config file/directory
[ -f "$HOME/.emacs" ] && rm "$HOME/.emacs"
[ -d "$HOME/.emacs.d" ] && rm -r "$HOME/.emacs.d"

View file

@ -11,7 +11,7 @@
./starship.nix
];
home.shellAliases = {
sync-all = "sync-emacs; sync-git; vdirsyncer sync; mbsync -a";
sync-all = "sync-git; vdirsyncer sync; mbsync -a";
sync-and-shutdown = "sync-all && shutdown now";
protonup = "sudo wg-quick up protonvpn && sudo wg";
protondown = "sudo wg-quick down protonvpn";