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

feat: add generation of installer image for each host

This commit is contained in:
oddlama 2023-04-26 23:52:25 +02:00
parent 05ce0e6f5c
commit 3e810b1711
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
7 changed files with 245 additions and 19 deletions

View file

@ -1,16 +1,63 @@
{
fileSystems = {
"/" = {
device = "rpool/root/nixos";
fsType = "zfs";
options = ["zfsutil" "X-mount.mkdir"];
};
"/boot" = {
device = "/dev/disk/by-uuid/10E6-553F";
fsType = "vfat";
extraLib,
pkgs,
...
}: {
disko.devices = {
disk = {
m2-ssd = {
type = "disk";
device = "/dev/disk/by-id/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
content = {
type = "table";
format = "gpt";
partitions = [
{
name = "efi";
start = "2048";
end = "1GiB";
fs-type = "fat32";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
}
{
name = "swap";
start = "1GiB";
end = "17GiB";
content = {
type = "swap";
randomEncryption = true;
};
}
{
name = "rpool";
start = "17GiB";
end = "100%";
content = {
type = "zfs";
pool = "rpool";
};
}
];
};
};
};
zpool = extraLib.disko.defineEncryptedZpool "rpool" {};
};
swapDevices = [];
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";
};
};
};
}