2024-01-14 14:38:22 +00:00
|
|
|
HOST=$1
|
2024-03-04 14:45:20 +00:00
|
|
|
for TARGET in bat bottom git zellij starship.toml; do
|
2024-02-03 09:55:02 +00:00
|
|
|
SOURCE="$HOME/.config/$TARGET"
|
2024-02-05 09:51:38 +00:00
|
|
|
echo "--- $SOURCE ---"
|
2024-02-03 09:55:02 +00:00
|
|
|
TMP_TARGET=/tmp/rsync-local-config
|
|
|
|
TMP_SOURCE=$TMP_TARGET
|
|
|
|
NIX_SED="sed -i 's|/nix/.*/bin/||g'"
|
|
|
|
NIX_REPLACE="$NIX_SED $TMP_TARGET"
|
|
|
|
if [[ -e $SOURCE ]]; then
|
|
|
|
if [[ -d $SOURCE ]]; then
|
|
|
|
SOURCE=$SOURCE/
|
|
|
|
TMP_SOURCE=$TMP_SOURCE/
|
|
|
|
NIX_REPLACE="fd -g '**' $TMP_TARGET -tfile -x $NIX_SED {};"
|
|
|
|
fi
|
2024-03-01 11:33:34 +00:00
|
|
|
rsync -avzL --exclude=".git*" "$SOURCE" $TMP_TARGET
|
2024-02-03 09:55:02 +00:00
|
|
|
chmod u+rw -R $TMP_SOURCE
|
|
|
|
sh -c "$NIX_REPLACE"
|
2024-03-01 11:33:34 +00:00
|
|
|
rsync -avzL --delete --exclude=".git*" $TMP_SOURCE "$HOST:.config/$TARGET"
|
2024-02-03 09:55:02 +00:00
|
|
|
rm -rf $TMP_SOURCE
|
|
|
|
fi
|
2024-01-14 14:38:22 +00:00
|
|
|
done
|