Normalise snake cases as dashes.
Some checks failed
Build Nix modules (dry-run) / build-modules (push) Failing after 5m19s

This commit is contained in:
Root User 2026-10-05 12:04:28 +02:00
parent b0a415a7ee
commit 44532cc3a3
Signed by: root
GPG key ID: 087F0A95E5766D72
2 changed files with 17 additions and 12 deletions

View file

@ -210,12 +210,15 @@ fi
# Step 4: Rebuild system using local flake
# Compute repository root (three levels up from this script: .../nix-system-configs/modules/scripts -> repo root)
FLAKE_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
# Normalize selected system name to flake nixosConfigurations naming convention (prefix with 'nixos-' if missing)
if [[ "${selected_system}" == nixos-* ]]; then
flake_name="${selected_system}"
else
flake_name="nixos-${selected_system}"
fi
# Map repository configuration filenames to flake nixosConfigurations names.
# Normalise the snake-cases as dashes.
case "${selected_system}" in
blank_system_USE_THIS_AS_COPY) flake_name="nixos-blank" ;;
gramethus) flake_name="nixos-logs" ;;
wireguard_server) flake_name="nixos-local-wireguard-server" ;;
nixos-*) flake_name="${selected_system}" ;;
*) flake_name="nixos-${selected_system//_/-}" ;;
esac
# If the selected system is the database module, use the standard non-flake rebuild
if [[ "${selected_system}" == "database" ]]; then

View file

@ -102,12 +102,14 @@ echo ""
# Step 1: Rebuild system
print_info "Rebuilding NixOS system..."
# Normalize selected system name to flake nixosConfigurations naming convention (prefix with 'nixos-' if missing)
if [[ "${selected_system}" == nixos-* ]]; then
flake_name="${selected_system}"
else
flake_name="nixos-${selected_system}"
fi
# Map repository configuration filenames to flake nixosConfigurations names.
case "${selected_system}" in
blank_system_USE_THIS_AS_COPY) flake_name="nixos-blank" ;;
gramethus) flake_name="nixos-logs" ;;
wireguard_server) flake_name="nixos-local-wireguard-server" ;;
nixos-*) flake_name="${selected_system}" ;;
*) flake_name="nixos-${selected_system//_/-}" ;;
esac
echo ""
if sudo NIX_CONFIG='experimental-features = nix-command flakes' nixos-rebuild switch --upgrade-all --flake "${PWD}#${flake_name}"; then