Update rsync-local-config function

Add heimdall back to ssh config
This commit is contained in:
Evie Litherland-Smith 2023-11-02 11:04:49 +00:00
parent 873fa72872
commit 52c16f4107

View file

@ -80,6 +80,11 @@
}; };
}]; }];
}; };
"heimdall" = {
user = "elitherl";
hostname = "heimdall003.jet.uk";
compression = true;
};
}; };
}; };
starship = { starship = {
@ -210,9 +215,9 @@
} }
rsync-local-config () { rsync-local-config () {
HOST=$1 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" SOURCE="${config.xdg.configHome}/$TARGET"
TMP_TARGET=/tmp/config-$TARGET TMP_TARGET=/tmp/rsync-local-config
TMP_SOURCE=$TMP_TARGET TMP_SOURCE=$TMP_TARGET
NIX_SED="${pkgs.gnused}/bin/sed -i 's|/nix/.*/bin/||g'" NIX_SED="${pkgs.gnused}/bin/sed -i 's|/nix/.*/bin/||g'"
NIX_REPLACE="$NIX_SED $TMP_TARGET" NIX_REPLACE="$NIX_SED $TMP_TARGET"
@ -222,10 +227,10 @@
TMP_SOURCE=$TMP_SOURCE/ TMP_SOURCE=$TMP_SOURCE/
NIX_REPLACE="${pkgs.fd}/bin/fd -g '**' $TMP_TARGET -tfile -x $NIX_SED {};" NIX_REPLACE="${pkgs.fd}/bin/fd -g '**' $TMP_TARGET -tfile -x $NIX_SED {};"
fi 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.coreutils}/bin/chmod u+rw -R $TMP_SOURCE
${pkgs.bash}/bin/sh -c "$NIX_REPLACE" ${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 ${pkgs.coreutils}/bin/rm -rf $TMP_SOURCE
fi fi
done done