From ce519b33439f0aa3481437dc71f6bde7be559d75 Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Sat, 7 Feb 2026 23:03:54 +0100 Subject: [PATCH] Update the pulling so it can copy system scripts --- nix-system-configs/modules/scripts/pull.zsh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nix-system-configs/modules/scripts/pull.zsh b/nix-system-configs/modules/scripts/pull.zsh index 3b0883e..f31829b 100644 --- a/nix-system-configs/modules/scripts/pull.zsh +++ b/nix-system-configs/modules/scripts/pull.zsh @@ -117,6 +117,8 @@ else exit 1 fi +## Todo System Conditional pulling of directories (only if it exists) + # Step 2.1: Sync secrets directory # nix-system-configs/modules/scripts /pull.zsh # nix-system-configs/secrets/songsheet/secrets.yaml @@ -135,6 +137,22 @@ else print_warn "Secrets directory not found: ${SECRETS_DIR}" fi +# Step 2.2: Sync system_scripts directory +SYSTEM_SCRIPT_DIR="${SCRIPT_DIR}/../../system_scripts" +SYSTEM_SCRIPT_TARGET="/etc/nixos/system_scripts" + +if [[ -d "$SECRETS_DIR" ]]; then + print_info "Syncing system scripts to ${BOLD}${SYSTEM_SCRIPT_TARGET}${RESET}..." + if sudo rsync -av --delete "${SYSTEM_SCRIPT_DIR}/" "${SYSTEM_SCRIPT_TARGET}/"; then + print_success "System scripts synced" + else + print_error "Failed to sync system scripts" + exit 1 + fi +else + print_warn "System scripts directory not found: ${SYSTEM_SCRIPT_DIR}" +fi + # Step 3: Copy configuration source_file="${SYSTEM_DIR}/${selected_system}.nix"