Update nix

This commit is contained in:
Sage 2026-04-20 10:41:21 +00:00
parent 835c6345ed
commit 68d5cac1be
4 changed files with 54 additions and 49 deletions

View file

@ -13,10 +13,14 @@ with lib; {
files = ["/var/lib/sops-nix/key.txt" "/etc/machine-id"];
};
boot.initrd.postResumeCommands =
lib.mkAfter # sh
''
boot.initrd.systemd.services.rollback = {
description = "Roll back root btrfs subvolume";
wantedBy = ["initrd.target"];
after = ["cryptsetup.target"];
before = ["sysroot.mount"];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
mkdir /btrfs_tmp
mount /dev/mapper/crypted /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
@ -40,5 +44,6 @@ with lib; {
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
};
};
}