This repository has been archived on 2024-07-03. You can view files and clone it, but cannot push or open issues or pull requests.
home-manager/scripts/rsync-local-config.sh
Evie Litherland-Smith 10db59de2a Initial add of copied files
Probably not in a working state at the moment, but home-manager will
build. Needs proper configuring to be used
2024-05-11 13:55:23 +01:00

26 lines
1.2 KiB
Bash
Executable file

HOST=$1
# Config files
for TARGET in bat bottom git starship.toml; do
SOURCE="$HOME/.config/$TARGET"
echo "--- $SOURCE ---"
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
rsync -avzL --exclude=".git*" --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r "$SOURCE" $TMP_TARGET
sh -c "$NIX_REPLACE"
rsync -avzL --delete --exclude=".git*" $TMP_SOURCE "$HOST:.config/$TARGET"
rm -rf $TMP_SOURCE
fi
done
# 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"