dotfiles/nixos/hardware/mark.nix
Magic_RB 0a356cb01a
Update mark to be RAIDed on ZFS
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2023-04-03 12:41:58 +02:00

80 lines
1.7 KiB
Nix

# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
#
# SPDX-License-Identifier: LGPL-3.0-or-later
{
config,
lib,
...
}:
with lib; let
cfg = config.magic_rb.hardware.mark;
in {
options.magic_rb.hardware.mark = mkEnableOption "Enable mark.";
config = mkIf cfg {
boot = {
loader.grub = {
enable = true;
version = 2;
mirroredBoots = [
{
devices = [
"/dev/disk/by-id/usb-Verbatim_STORE_N_GO_072124EF1B657269-0:0"
];
path = "/boot1";
}
{
devices = [
"/dev/disk/by-id/usb-Verbatim_STORE_N_GO_072124E17216D761-0:0"
];
path = "/boot2";
}
];
efiSupport = false;
enableCryptodisk = true;
};
initrd = {
luks.devices = {
boot1 = {
device = "/dev/disk/by-partuuid/51ee175f-bc24-9545-803e-b39eb99a5513";
preLVM = true;
};
boot2 = {
device = "/dev/disk/by-partuuid/c46fef20-f0e5-1c43-a515-78baf8fff6c3";
preLVM = true;
};
};
supportedFilesystems = ["zfs"];
availableKernelModules = [
"xhci_pci"
"ahci"
"usbhid"
"aesni_intel"
"cryptd"
];
};
};
fileSystems = {
"/" = {
device = "mark-usb/root";
fsType = "zfs";
};
"/boot1" = {
device = "/dev/mapper/mark-boot-1";
fsType = "ext4";
};
"/boot2" = {
device = "/dev/mapper/mark-boot-2";
fsType = "ext4";
};
};
networking.hostId = "fab3c3c6";
};
}