diff --git a/nix-system-configs/modules/scripts/pull.zsh b/nix-system-configs/modules/scripts/pull.zsh index 6c61cfd..6a15763 100644 --- a/nix-system-configs/modules/scripts/pull.zsh +++ b/nix-system-configs/modules/scripts/pull.zsh @@ -117,6 +117,17 @@ else exit 1 fi +# Step 2.1: Sync secrets directory +SECRETS_DIR="${SCRIPT_DIR}/../secrets" +SECRETS_TARGET="/etc/nixos/secrets" + +if [[ -d "$SECRETS_DIR" ]]; then + print_info "Syncing secrets to ${BOLD}${SECRETS_TARGET}${RESET}..." + if sudo rsync -av --delete "${SECRETS_DIR}/" "${SECRETS_TARGET}/"; then + print_success "Secrets synced" + else + print_error "Failed to sync secrets" + # Step 3: Copy configuration source_file="${SYSTEM_DIR}/${selected_system}.nix" print_info "Copying ${BOLD}${source_file}${RESET} to ${BOLD}${CONFIG_TARGET}${RESET}..."