fix(impermanence): work aorund docker and systemd subvols

This commit is contained in:
buffet 2023-05-02 12:15:58 +02:00
parent b733481b2e
commit 35fd160476
2 changed files with 12 additions and 1 deletions

View file

@ -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";

View file

@ -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"
'';
};