101 lines
2.5 KiB
Nix
101 lines
2.5 KiB
Nix
{
|
|
lib,
|
|
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 = lib.mkForce "/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;
|
|
};
|
|
|
|
"/boot" = {
|
|
device = "/dev/disk/by-uuid/9071-3F2A";
|
|
fsType = "vfat";
|
|
};
|
|
|
|
"/nix" = {
|
|
device = "rpool/local/nix";
|
|
fsType = "zfs";
|
|
options = ["zfsutil"];
|
|
};
|
|
|
|
"/persist" = {
|
|
device = "rpool/safe/persist";
|
|
fsType = "zfs";
|
|
options = ["zfsutil"];
|
|
};
|
|
|
|
"/data/dirty" = {
|
|
device = "zdirty";
|
|
fsType = "zfs";
|
|
options = ["zfsutil"];
|
|
};
|
|
|
|
"/data/hdd/1" = {
|
|
device = "/dev/disk/by-uuid/7f651391-1098-49c1-a2f7-38e91ac43efa";
|
|
fsType = "ext4";
|
|
options = ["defaults" "nofail"];
|
|
};
|
|
"/data/hdd/2" = {
|
|
device = "/dev/disk/by-uuid/bb946f66-c3cb-4f5d-b79c-3754c5c8e1ea";
|
|
fsType = "ext4";
|
|
options = ["defaults" "nofail"];
|
|
};
|
|
"/data/hdd/3" = {
|
|
device = "/dev/disk/by-uuid/af52a67b-32c6-437c-8916-260caab81540";
|
|
fsType = "ext4";
|
|
options = ["defaults" "nofail"];
|
|
};
|
|
"/data/hdd/4" = {
|
|
device = "/dev/disk/by-uuid/09437c69-91d6-4afe-a475-fe7cdab62ddb";
|
|
fsType = "ext4";
|
|
options = ["defaults" "nofail"];
|
|
};
|
|
"/data/hdd/5" = {
|
|
device = "/dev/disk/by-uuid/8508e5d9-9065-4b5f-b50f-1386a5c9430a";
|
|
fsType = "ext4";
|
|
options = ["defaults" "nofail"];
|
|
};
|
|
};
|
|
|
|
# === Swap ===
|
|
swapDevices = [
|
|
{device = "/dev/disk/by-uuid/206155f9-6ca0-4d0e-a269-c19766e56902";}
|
|
];
|
|
}
|