-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrebuild.sh
More file actions
executable file
·27 lines (21 loc) · 1015 Bytes
/
rebuild.sh
File metadata and controls
executable file
·27 lines (21 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
set -e # Exit on error
cd /root/nixos-config
git pull
# Build system to a known path
echo "[rebuild.sh] Building NixOS configuration..."
nix --extra-experimental-features 'nix-command flakes' build .#nixosConfigurations.atom-c3758.config.system.build.toplevel --out-link /root/nixos-config/result-system
# Activate directly, bypassing nixos-rebuild and systemd-run
echo "[rebuild.sh] Activating new configuration..."
/root/nixos-config/result-system/bin/switch-to-configuration switch
# Update boot entries automatically (neueste Generation als Default, letzte 3 behalten)
echo "[rebuild.sh] Updating boot entries..."
/root/nixos-config/update-boot.sh
# Push changes to remote if rebuild was successful
echo "[rebuild.sh] Pushing changes to remote repository..."
if git push origin main; then
echo "[rebuild.sh] ✓ Changes pushed successfully"
else
echo "[rebuild.sh] ✗ Warning: Failed to push changes to remote (continuing anyway)"
fi
echo "[rebuild.sh] ✓ Rebuild completed successfully"