rebuild: remove dix and nom

This commit is contained in:
sid 2026-05-10 15:50:04 +02:00
parent 997c4a98dc
commit 597a100bb2
2 changed files with 11 additions and 19 deletions

View file

@ -7,8 +7,6 @@
hostname, hostname,
nix, nix,
nixos-rebuild-ng, nixos-rebuild-ng,
nix-output-monitor,
dix,
... ...
}: }:
@ -28,7 +26,5 @@ writeShellApplication {
hostname hostname
nix nix
nixos-rebuild-ng nixos-rebuild-ng
nix-output-monitor
dix
]; ];
} }

View file

@ -48,7 +48,6 @@ Rebuild_nixos() {
# Construct rebuild command # Construct rebuild command
local CMD=("nixos-rebuild" "switch" "--sudo") local CMD=("nixos-rebuild" "switch" "--sudo")
[[ -n "$TARGET_HOST" || -n "$BUILD_HOST" ]] && CMD+=("--ask-sudo-password")
CMD+=("--flake" "$FLAKE") CMD+=("--flake" "$FLAKE")
[ "$ROLLBACK" = 1 ] && CMD+=("--rollback") [ "$ROLLBACK" = 1 ] && CMD+=("--rollback")
[ "$SHOW_TRACE" = 1 ] && CMD+=("--show-trace") [ "$SHOW_TRACE" = 1 ] && CMD+=("--show-trace")
@ -58,6 +57,7 @@ Rebuild_nixos() {
_status "Using '$TARGET_HOST' as target host." _status "Using '$TARGET_HOST' as target host."
fi fi
[ -n "$TARGET_HOST" ] && CMD+=("--target-host" "$TARGET_HOST") [ -n "$TARGET_HOST" ] && CMD+=("--target-host" "$TARGET_HOST")
[[ -n "$TARGET_HOST" || -n "$BUILD_HOST" ]] && CMD+=("--ask-sudo-password")
# Build config first so we can diff it # Build config first so we can diff it
local BUILD_CMD=("nixos-rebuild" "build" "--flake" "$FLAKE") local BUILD_CMD=("nixos-rebuild" "build" "--flake" "$FLAKE")
@ -67,18 +67,16 @@ Rebuild_nixos() {
if [ "$ROLLBACK" = 0 ]; then if [ "$ROLLBACK" = 0 ]; then
_status "Building NixOS configuration '$FLAKE'..." _status "Building NixOS configuration '$FLAKE'..."
_status "Executing command: ${BUILD_CMD[*]}" _status "Executing command: ${BUILD_CMD[*]}"
"${BUILD_CMD[@]}" |&nom || error "NixOS build failed" "${BUILD_CMD[@]}" || error "NixOS build failed"
_status "Package diff:"
dix /run/current-system result _status "Switching to new NixOS configuration"
rm result
else else
_status "Rolling back to last NixOS generation..." _status "Rolling back to last NixOS generation"
fi fi
_status "Switching to new NixOS configuration"
sudo -v sudo -v
_status "Executing command: ${CMD[*]}" _status "Executing command: ${CMD[*]}"
"${CMD[@]}" |& nom || error "NixOS rebuild failed" "${CMD[@]}" || error "NixOS rebuild failed"
success "NixOS rebuild completed successfully." success "NixOS rebuild completed successfully."
} }
@ -107,17 +105,15 @@ Rebuild_home() {
[ "$SHOW_TRACE" = 1 ] && BUILD_CMD+=("--show-trace") [ "$SHOW_TRACE" = 1 ] && BUILD_CMD+=("--show-trace")
_status "Building Home Manager configuration '$FLAKE'..." _status "Building Home Manager configuration '$FLAKE'..."
_status "Executing command: ${BUILD_CMD[*]}" _status "Executing command: ${BUILD_CMD[*]}"
"${BUILD_CMD[@]}" |& nom || error "Home Manager build failed" "${BUILD_CMD[@]}" || error "Home Manager build failed"
_status "Package diff:"
dix /run/current-system result _status "Switching to new Home Manager configuration"
rm result
else else
_status "Rolling back to last Home Manager generation..." _status "Rolling back to last Home Manager generation"
fi fi
_status "Switching to new Home Manager configuration"
_status "Executing command: ${CMD[*]}" _status "Executing command: ${CMD[*]}"
"${CMD[@]}" |& nom || error "Home Manager rebuild failed" "${CMD[@]}" || error "Home Manager rebuild failed"
success "Home Manager rebuild completed successfully." success "Home Manager rebuild completed successfully."
} }