From a9c5bcf7a30de41c453a6b606abc39f123b74c25 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 13 May 2024 11:24:17 +0100 Subject: [PATCH] Make rsync-local-config more efficient and fix missing flake Accept multiple hosts as arguments to script, rsync to all given within the TARGET loop so only needs one copy to /tmp Fix missing flake reference flake:iosevka by using exact URI instead --- scripts/shell/rsync-local-config.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/shell/rsync-local-config.sh b/scripts/shell/rsync-local-config.sh index 6de2682..d7184e7 100755 --- a/scripts/shell/rsync-local-config.sh +++ b/scripts/shell/rsync-local-config.sh @@ -1,4 +1,4 @@ -HOST=$1 +HOSTS=("$@") # Config files for TARGET in bat bottom git starship.toml; do SOURCE="$HOME/.config/$TARGET" @@ -15,11 +15,19 @@ for TARGET in bat bottom git starship.toml; do 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" + for HOST in "${HOSTS[@]}"; do + rsync -avzL --delete --exclude=".git*" $TMP_SOURCE "$HOST:.config/$TARGET" + done 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" +IOSEVKA_FLAKE_URL="git+https://git.xenia.me.uk/pixelifytica/iosevka.git?ref=main" +IOSEVKA_CUSTOM_NERDFONT="$IOSEVKA_FLAKE_URL#packages.x86_64-linux.iosevka-custom-nerdfont" +IOSEVKA_CUSTOM_AILE="$IOSEVKA_FLAKE_URL#packages.x86_64-linux.iosevka-custom-aile" +echo "--- Fonts ---" +for HOST in "${HOSTS[@]}"; do + rsync -avzL --delete --exclude=".git*" --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r "$(nix path-info "$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 "$IOSEVKA_CUSTOM_AILE")/share/fonts/truetype/" "$HOST:.fonts/IosevkaCustomAile" +done