mirror of
https://codeberg.org/polyteknisk-radiogruppe/the_prg_server_configuration.git
synced 2026-06-13 18:28:55 +02:00
Fix the script...
This commit is contained in:
parent
947b4d711c
commit
d2b554b18c
2 changed files with 17 additions and 3 deletions
|
|
@ -184,9 +184,15 @@ fi
|
||||||
# Step 4: Rebuild system using local flake
|
# Step 4: Rebuild system using local flake
|
||||||
# Compute repository root (three levels up from this script: .../nix-system-configs/modules/scripts -> repo root)
|
# Compute repository root (three levels up from this script: .../nix-system-configs/modules/scripts -> repo root)
|
||||||
FLAKE_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
FLAKE_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
||||||
print_info "Rebuilding NixOS system using flake at ${BOLD}${FLAKE_ROOT}${RESET}..."
|
# 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
|
||||||
|
print_info "Rebuilding NixOS system using flake at ${BOLD}${FLAKE_ROOT}#${flake_name}${RESET}..."
|
||||||
echo ""
|
echo ""
|
||||||
if sudo NIX_CONFIG='experimental-features = nix-command flakes' nixos-rebuild switch --upgrade-all --flake "${FLAKE_ROOT}#${selected_system}"; then
|
if sudo NIX_CONFIG='experimental-features = nix-command flakes' nixos-rebuild switch --upgrade-all --flake "${FLAKE_ROOT}#${flake_name}"; then
|
||||||
print_success "System rebuild completed successfully!"
|
print_success "System rebuild completed successfully!"
|
||||||
else
|
else
|
||||||
print_error "System rebuild failed"
|
print_error "System rebuild failed"
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,16 @@ echo ""
|
||||||
|
|
||||||
# Step 1: Rebuild system
|
# Step 1: Rebuild system
|
||||||
print_info "Rebuilding NixOS 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
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
if sudo nixos-rebuild switch --upgrade-all; then
|
if sudo NIX_CONFIG='experimental-features = nix-command flakes' nixos-rebuild switch --upgrade-all --flake "${PWD}#${flake_name}"; then
|
||||||
print_success "System rebuild completed"
|
print_success "System rebuild completed"
|
||||||
else
|
else
|
||||||
print_error "System rebuild failed"
|
print_error "System rebuild failed"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue