1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

feat: properly ensure vm zfs dataset exists

This commit is contained in:
oddlama 2023-05-21 22:57:40 +02:00
parent a0d22b8be1
commit f3ed1248af
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
9 changed files with 74 additions and 25 deletions

View file

@ -37,7 +37,17 @@
};
in {
test = defineVm 11;
#hi = defineVm 12;
hi = defineVm 12;
};
microvm.vms.hi.config = {
imports = [
../common/core
../../users/root
];
home-manager.users.root.home.minimal = true;
rekey.hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBXXjI6uB26xOF0DPy/QyLladoGIKfAtofyqPgIkCH/g";
};
microvm.vms.test.config = {

View file

@ -44,16 +44,14 @@
fileSystems."/persist".neededForBoot = true;
# After importing the rpool, rollback the root system to be empty.
boot.initrd.systemd.services = {
impermanence-root = {
wantedBy = ["initrd.target"];
after = ["zfs-import-rpool.service"];
before = ["sysroot.mount"];
unitConfig.DefaultDependencies = "no";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r rpool/local/root@blank";
};
boot.initrd.systemd.services.impermanence-root = {
wantedBy = ["initrd.target"];
after = ["zfs-import-rpool.service"];
before = ["sysroot.mount"];
unitConfig.DefaultDependencies = "no";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r rpool/local/root@blank";
};
};
}