chore: update flake

This commit is contained in:
Moritz Böhme 2024-10-08 09:42:32 +02:00
parent 22a6b5156c
commit 87473baed4
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
8 changed files with 225 additions and 190 deletions

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib, pkgs, ... }:
{
# needed for zfs pool
@ -76,9 +76,27 @@
};
};
# rollback to blank
boot.initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r zroot/encrypted/root@blank
'';
boot.initrd.systemd.services.rollback = {
description = "Rollback ZFS datasets to a pristine state";
wantedBy = [
"initrd.target"
];
after = [
"zfs-import-zroot.service"
];
before = [
"sysroot.mount"
];
path = with pkgs; [
zfs
];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
zfs rollback -r zroot/encrypted/root@blank && echo "rollback complete"
'';
};
boot.initrd.systemd.enable = true;
fileSystems."/persist".neededForBoot = true;
# HACK: to fix issue of agenix running before impermanence
age.identityPaths = [