mirror of
https://github.com/Death916/nixconfig.git
synced 2026-04-10 02:54:39 -07:00
nh-push snapshot first
This commit is contained in:
parent
f267107e7b
commit
c8a0ec5580
1 changed files with 8 additions and 0 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue