Move Emacs syncing from git-sync-all to separate script (esync.sh)
This commit is contained in:
parent
83d362bba2
commit
5192d3a07f
|
@ -2,18 +2,14 @@
|
||||||
{
|
{
|
||||||
home = {
|
home = {
|
||||||
packages = [
|
packages = [
|
||||||
|
(pkgs.writeShellScriptBin "esync" (builtins.readFile ./shell/esync.sh))
|
||||||
(pkgs.writeShellScriptBin "git-sync-all" (builtins.readFile ./shell/git-sync-all.sh))
|
(pkgs.writeShellScriptBin "git-sync-all" (builtins.readFile ./shell/git-sync-all.sh))
|
||||||
(pkgs.writeShellScriptBin "rsync-local-config" (builtins.readFile ./shell/rsync-local-config.sh))
|
(pkgs.writeShellScriptBin "rsync-local-config" (builtins.readFile ./shell/rsync-local-config.sh))
|
||||||
(pkgs.writeShellScriptBin "xdg-query-program" (builtins.readFile ./shell/xdg-query-program.sh))
|
(pkgs.writeShellScriptBin "xdg-query-program" (builtins.readFile ./shell/xdg-query-program.sh))
|
||||||
];
|
];
|
||||||
shellAliases =
|
shellAliases = {
|
||||||
let
|
gsa = "git-sync-all";
|
||||||
sync = "sudo systemctl start nixos-upgrade.service && git-sync-all";
|
sync-and-shutdown = "sudo systemctl start nixos-upgrade.service && git-sync-all && shutdown now";
|
||||||
in
|
};
|
||||||
{
|
|
||||||
gsa = "git-sync-all";
|
|
||||||
sync-and-shutdown = sync + " && shutdown now";
|
|
||||||
sync-and-reboot = sync + " && reboot";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
12
home/scripts/shell/esync.sh
Executable file
12
home/scripts/shell/esync.sh
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
# Clone ~/.emacs.d/ if it doesn't exist
|
||||||
|
EMACS_DIR="$HOME/.emacs.d/"
|
||||||
|
if [ ! -d "$EMACS_DIR" ]; then
|
||||||
|
git clone "https://git.xenia.me.uk/pixelifytica/emacs.git" "$EMACS_DIR"
|
||||||
|
fi
|
||||||
|
(
|
||||||
|
cd "$EMACS_DIR" || exit 1
|
||||||
|
# Pull changes by fast-forwarding only
|
||||||
|
git pull --ff --ff-only
|
||||||
|
# Install and update extensions
|
||||||
|
make install
|
||||||
|
)
|
|
@ -1,10 +1,3 @@
|
||||||
# Clone ~/.emacs.d/ if it doesn't exist, fast-forward pull
|
|
||||||
EMACS_DIR="$HOME/.emacs.d/"
|
|
||||||
if [ ! -d "$EMACS_DIR" ]; then
|
|
||||||
git clone "https://git.xenia.me.uk/pixelifytica/emacs.git" "$EMACS_DIR"
|
|
||||||
fi
|
|
||||||
git -C "$EMACS_DIR" pull --ff --ff-only
|
|
||||||
|
|
||||||
# Sync common directories, setting url to ensure it's up-to-date first
|
# Sync common directories, setting url to ensure it's up-to-date first
|
||||||
SYNC_DIRS=(
|
SYNC_DIRS=(
|
||||||
"$HOME/.password-store/"
|
"$HOME/.password-store/"
|
||||||
|
|
Loading…
Reference in a new issue