From 52c16f4107bd34b1af28b12bd60ae49b2fec16f1 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 2 Nov 2023 11:04:49 +0000 Subject: [PATCH] Update rsync-local-config function Add heimdall back to ssh config --- home/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/home/default.nix b/home/default.nix index 05ecad26..60a36386 100644 --- a/home/default.nix +++ b/home/default.nix @@ -80,6 +80,11 @@ }; }]; }; + "heimdall" = { + user = "elitherl"; + hostname = "heimdall003.jet.uk"; + compression = true; + }; }; }; starship = { @@ -210,9 +215,9 @@ } rsync-local-config () { HOST=$1 - for TARGET in bat emacs git starship.toml; do + for TARGET in bat git emacs/init.el emacs/modules emacs/crafted-emacs emacs/snippets starship.toml; do SOURCE="${config.xdg.configHome}/$TARGET" - TMP_TARGET=/tmp/config-$TARGET + TMP_TARGET=/tmp/rsync-local-config TMP_SOURCE=$TMP_TARGET NIX_SED="${pkgs.gnused}/bin/sed -i 's|/nix/.*/bin/||g'" NIX_REPLACE="$NIX_SED $TMP_TARGET" @@ -222,10 +227,10 @@ TMP_SOURCE=$TMP_SOURCE/ NIX_REPLACE="${pkgs.fd}/bin/fd -g '**' $TMP_TARGET -tfile -x $NIX_SED {};" fi - ${pkgs.rsync}/bin/rsync -avzL --exclude=".git*" $SOURCE /tmp/config-$TARGET + ${pkgs.rsync}/bin/rsync -avzL --exclude=".git*" $SOURCE $TMP_TARGET ${pkgs.coreutils}/bin/chmod u+rw -R $TMP_SOURCE ${pkgs.bash}/bin/sh -c "$NIX_REPLACE" - ${pkgs.rsync}/bin/rsync -avzL --exclude=".git*" $TMP_SOURCE $HOST:.config/$TARGET + ${pkgs.rsync}/bin/rsync -avzL --delete --exclude=".git*" $TMP_SOURCE $HOST:.config/$TARGET ${pkgs.coreutils}/bin/rm -rf $TMP_SOURCE fi done