From dc04bcf008295df160f8a599b364197c9d06f6c0 Mon Sep 17 00:00:00 2001 From: randogoth Date: Sat, 14 Feb 2026 17:28:34 +0200 Subject: [PATCH] fix impermanence rollback and add persistent paths --- modules/system/impermanence.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/system/impermanence.nix b/modules/system/impermanence.nix index 790a469..04cf1b7 100644 --- a/modules/system/impermanence.nix +++ b/modules/system/impermanence.nix @@ -19,6 +19,21 @@ fi if [ -d /mnt/root ]; then + if [ -d /mnt/root-previous ]; then + btrfs subvolume delete /mnt/root-previous + fi + btrfs subvolume snapshot /mnt/root /mnt/root-previous + + while true; do + subvols="$(btrfs subvolume list -o /mnt/root | awk '{print $9}')" + if [ -z "$subvols" ]; then + break + fi + for subvol in $subvols; do + btrfs subvolume delete "/mnt/$subvol" + done + done + btrfs subvolume delete /mnt/root fi @@ -34,8 +49,11 @@ "/etc/nixos" "/etc/ssh" "/etc/cups" + "/var/lib/bluetooth" "/var/lib/cups" + "/var/lib/fprint" "/var/lib/libvirt" + "/var/lib/NetworkManager" "/var/lib/secureboot" "/var/lib/tailscale" "/var/lib/systemd"