mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-07 13:32:15 -06:00
test: impermanence
This commit is contained in:
parent
e81fd3c97a
commit
f5d5950e0a
1 changed files with 6 additions and 6 deletions
|
|
@ -12,7 +12,7 @@ in
|
||||||
"/" = {
|
"/" = {
|
||||||
device = "/dev/disk/by-uuid/00d712c2-5883-4409-afd8-514886f4e824";
|
device = "/dev/disk/by-uuid/00d712c2-5883-4409-afd8-514886f4e824";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=root" ];
|
options = [ "subvol=@" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/nix" = {
|
"/nix" = {
|
||||||
|
|
@ -42,12 +42,12 @@ in
|
||||||
|
|
||||||
boot.initrd.postResumeCommands = lib.mkAfter ''
|
boot.initrd.postResumeCommands = lib.mkAfter ''
|
||||||
mkdir /btrfs_tmp
|
mkdir /btrfs_tmp
|
||||||
mount -o subvolid=5 /dev/sdb2 /btrfs_tmp
|
mount -o subvolid=5 /dev/sda2 /btrfs_tmp
|
||||||
|
|
||||||
if [[ -e /btrfs_tmp/root ]]; then
|
if [[ -e /btrfs_tmp/@ ]]; then
|
||||||
mkdir -p /btrfs_tmp/old_roots
|
mkdir -p /btrfs_tmp/old_roots
|
||||||
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/@)" "+%Y-%m-%-d_%H:%M:%S")
|
||||||
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
mv /btrfs_tmp/@ "/btrfs_tmp/old_roots/$timestamp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
delete_subvolume_recursively() {
|
delete_subvolume_recursively() {
|
||||||
|
|
@ -62,7 +62,7 @@ in
|
||||||
delete_subvolume_recursively "$i"
|
delete_subvolume_recursively "$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
btrfs subvolume create /btrfs_tmp/root
|
btrfs subvolume create /btrfs_tmp/@
|
||||||
umount /btrfs_tmp
|
umount /btrfs_tmp
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue