nh-push snapshot first

This commit is contained in:
death916 2025-07-16 02:53:17 -07:00
parent f267107e7b
commit c8a0ec5580

View file

@ -15,6 +15,14 @@ echo "Pulling latest changes from git..."
# Use -C to specify the repository path for git operations. # Use -C to specify the repository path for git operations.
git -C "$REPO_ROOT" pull git -C "$REPO_ROOT" pull
# --- Snapshot Creation (Laptop only) ---
if [ "$(hostname)" = "nixos" ]; then
echo "Creating Btrfs snapshots for /nix and /home..."
sudo btrfs subvolume snapshot -r /nix "/snapshots/nix_$(date +%Y-%m-%d_%H%M)"
sudo btrfs subvolume snapshot -r /home "/snapshots/home_$(date +%Y-%m-%d_%H%M)"
echo "Snapshots created."
fi
# --- NixOS Build --- # --- NixOS Build ---
echo "Building NixOS configuration..." echo "Building NixOS configuration..."
# Use --flake to specify the flake path. # Use --flake to specify the flake path.