fix: boot issues
This commit is contained in:
parent
4d2577e8eb
commit
14007ca4f8
1 changed files with 22 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ lib, ... }:
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# needed for zfs pool
|
# needed for zfs pool
|
||||||
|
@ -83,9 +83,27 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# rollback to blank
|
# rollback to blank
|
||||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
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"
|
zfs rollback -r zroot/encrypted/root@blank && echo "rollback complete"
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
|
boot.initrd.systemd.enable = true;
|
||||||
fileSystems."/persist".neededForBoot = true;
|
fileSystems."/persist".neededForBoot = true;
|
||||||
# HACK: to fix issue of agenix running before impermanence
|
# HACK: to fix issue of agenix running before impermanence
|
||||||
age.identityPaths = [
|
age.identityPaths = [
|
||||||
|
|
Loading…
Reference in a new issue