diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 89d5124..b113d98 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -23,6 +23,12 @@ options = ["subvol=@"]; }; + fileSystems."/old" = { + device = "/dev/disk/by-uuid/d2c87f01-cdb7-4871-ae9d-c3a843e1199d"; + fsType = "btrfs"; + options = ["subvol=@old"]; + }; + fileSystems."/persist" = { device = "/dev/disk/by-uuid/d2c87f01-cdb7-4871-ae9d-c3a843e1199d"; fsType = "btrfs"; diff --git a/impermanence.nix b/impermanence.nix index 935e8d4..aeb1fff 100644 --- a/impermanence.nix +++ b/impermanence.nix @@ -14,9 +14,12 @@ directories = [ "/etc/NetworkManager/system-connections" "/etc/nixos" + "/root/.ssh" "/srv" "/var/lib/bluetooth" + "/var/lib/docker" "/var/lib/machines" + "/var/lib/portables" "/var/log" ]; @@ -69,9 +72,11 @@ echo "recreating root subvolume..." mkdir -p /mnt mount ${config.fileSystems."/".device} /mnt - btrfs subvolume delete /mnt/@ + btrfs subvolume delete /mnt/@old + mv /mnt/@ /mnt/@old btrfs subvolume create /mnt/@ umount /mnt + echo "done recreating subvolume" ''; };