feat: add hyp-01
Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
parent
95cbbfb157
commit
a55ed8b41b
8 changed files with 306 additions and 1 deletions
115
hosts/hyp-01/modules/disko.nix
Normal file
115
hosts/hyp-01/modules/disko.nix
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
let
|
||||
disk1 = "/dev/disk/by-path/pci-0000:00:17.0-ata-2.0";
|
||||
disk2 = "/dev/disk/by-path/pci-0000:00:17.0-ata-3.0";
|
||||
in
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
disk1 = {
|
||||
type = "disk";
|
||||
device = disk1;
|
||||
content = {
|
||||
type = "table";
|
||||
format = "mbr";
|
||||
partitions = [
|
||||
{
|
||||
name = "boot-primary";
|
||||
size = "1G";
|
||||
bootable = true;
|
||||
type = "EF02";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "nofail" ];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zfs-a";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zroot";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
disk2 = {
|
||||
type = "disk";
|
||||
device = disk2;
|
||||
content = {
|
||||
type = "table";
|
||||
format = "mbr";
|
||||
partitions = [
|
||||
{
|
||||
name = "boot-secondary";
|
||||
size = "1G";
|
||||
bootable = true;
|
||||
type = "EF02";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot-fallback";
|
||||
mountOptions = [ "nofail" ];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zfs-b";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zroot";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
zpool = {
|
||||
zroot = {
|
||||
type = "zpool";
|
||||
mode = "mirror";
|
||||
rootFsOptions = {
|
||||
compression = "lz4";
|
||||
acltype = "posixacl";
|
||||
xattr = "sa";
|
||||
"com.sun:auto-snapshot" = "true";
|
||||
mountpoint = "none";
|
||||
};
|
||||
options.ashift = "12";
|
||||
datasets = {
|
||||
"root" = {
|
||||
type = "zfs_fs";
|
||||
options = {
|
||||
mountpoint = "none";
|
||||
encryption = "aes-256-gcm";
|
||||
keyformat = "passphrase";
|
||||
keylocation = "prompt";
|
||||
};
|
||||
};
|
||||
"root/nix" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/nix";
|
||||
options.atime = "off";
|
||||
};
|
||||
"root/persist" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/persist";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
boot.loader.grub = {
|
||||
device = disk1;
|
||||
|
||||
mirroredBoots = [
|
||||
{
|
||||
devices = [ disk2 ];
|
||||
path = "/boot-fallback";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue