nixos/hardware/asrock-z370-i3-black-box.nix

81 lines
1.9 KiB
Nix

{
config,
lib,
pkgs,
modulesPath,
...
}: let
cryptRoot.encrypted = {
enable = true;
blkDev = "/dev/disk/by-id/nvme-Samsung_SSD_960_PRO_512GB_S3EWNCAJ110156V-part3";
label = "crypt-root";
};
in {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
# === Boot options ===
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.supportedFilesystems = ["zfs"];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod"];
boot.initrd.kernelModules = ["usb_storage"];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.zfs.devNodes = "/dev/";
boot.kernelParams = [
# Increase ARC cache for zfs (https://nixos.wiki/wiki/ZFS)
"zfs.zfs_arc_max=12884901888"
];
# === Drives ===
boot.initrd.luks.devices.crypt-root = {
allowDiscards = true;
keyFile = "/dev/disk/by-id/usb-General_USB_Flash_Disk_0416KKFIDFY07WXD-0:0";
keyFileSize = 4096;
fallbackToPassword = true;
device = cryptRoot.encrypted.blkDev;
};
fileSystems."/" = {
device = "rpool/local/root";
fsType = "zfs";
options = ["zfsutil"];
inherit (cryptRoot) encrypted;
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/9071-3F2A";
fsType = "vfat";
};
fileSystems."/nix" = {
device = "rpool/local/nix";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/persist" = {
device = "rpool/safe/persist";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/data/dirty" = {
device = "zdirty";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/data/archive" = {
device = "zarchive";
fsType = "zfs";
options = ["zfsutil" "nofail"];
};
# === Swap ===
swapDevices = [
{device = "/dev/disk/by-uuid/206155f9-6ca0-4d0e-a269-c19766e56902";}
];
}