2024-01-14 14:38:22 +00:00
|
|
|
HOST=$1
|
2024-03-18 10:03:48 +00:00
|
|
|
# Config files
|
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-18 10:03:48 +00:00
|
|
|
rsync -avzL --exclude=".git*" --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r "$SOURCE" $TMP_TARGET
|
2024-02-03 09:55:02 +00:00
|
|
|
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
|
2024-03-18 10:03:48 +00:00
|
|
|
|
|
|
|
# Fonts
|
|
|
|
rsync -avzL --delete --exclude=".git*" --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r "$(nix path-info flake:iosevka#packages.x86_64-linux.iosevka-custom-nerdfont)/share/fonts/truetype/" "$HOST:.fonts/IosevkaCustomNerdFont"
|
|
|
|
rsync -avzL --delete --exclude=".git*" --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r "$(nix path-info flake:iosevka#packages.x86_64-linux.iosevka-custom-aile)/share/fonts/truetype/" "$HOST:.fonts/IosevkaCustomAile"
|