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

feat: add automatic zfs persistent dataset management to microvms

This commit is contained in:
oddlama 2023-05-14 00:27:29 +02:00
parent 2b4449569f
commit 70f7ef3023
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 166 additions and 91 deletions

View file

@ -21,8 +21,9 @@
"/etc/ssh/ssh_host_ed25519_key.pub"
];
directories = [
"/var/log"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/var/log"
];
};
}

View file

@ -30,6 +30,12 @@
macOffset = config.lib.net.mac.addPrivate nodeSecrets.networking.interfaces.lan.mac;
in {
test = {
zfs = {
enable = true;
pool = "rpool";
dataset = "safe/vms/test";
mountpoint = "/persist/vms/test";
};
autostart = true;
mac = macOffset "00:00:00:00:00:11";
macvtap = "lan";

View file

@ -35,6 +35,7 @@
"local/nix" = filesystem "/nix";
"safe" = unmountable;
"safe/persist" = filesystem "/persist";
"safe/vms" = unmountable;
};
};
};
@ -42,10 +43,6 @@
fileSystems."/persist".neededForBoot = true;
#environment.persistence."/persist".directories = [
# { directory = "/var/lib/acme"; user = "acme"; group = "acme"; }
#];
# After importing the rpool, rollback the root system to be empty.
boot.initrd.systemd.services = {
impermanence-root = {