2023-11-12 22:33:39 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
}: let
|
2022-05-27 18:11:47 +02:00
|
|
|
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;
|
2023-11-12 22:33:39 +01:00
|
|
|
keyFile = lib.mkForce "/dev/disk/by-id/usb-General_USB_Flash_Disk_0416KKFIDFY07WXD-0:0";
|
2022-05-27 18:11:47 +02:00
|
|
|
keyFileSize = 4096;
|
|
|
|
fallbackToPassword = true;
|
|
|
|
device = cryptRoot.encrypted.blkDev;
|
|
|
|
};
|
|
|
|
|
2024-02-12 09:58:49 +01:00
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "rpool/local/root";
|
|
|
|
fsType = "zfs";
|
|
|
|
options = ["zfsutil"];
|
|
|
|
inherit (cryptRoot) encrypted;
|
|
|
|
};
|
2022-05-27 18:11:47 +02:00
|
|
|
|
2024-02-12 09:58:49 +01:00
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-uuid/9071-3F2A";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
2022-05-27 18:11:47 +02:00
|
|
|
|
2024-02-12 09:58:49 +01:00
|
|
|
"/nix" = {
|
|
|
|
device = "rpool/local/nix";
|
|
|
|
fsType = "zfs";
|
|
|
|
options = ["zfsutil"];
|
|
|
|
};
|
2022-05-27 18:11:47 +02:00
|
|
|
|
2024-02-12 09:58:49 +01:00
|
|
|
"/persist" = {
|
|
|
|
device = "rpool/safe/persist";
|
|
|
|
fsType = "zfs";
|
|
|
|
options = ["zfsutil"];
|
|
|
|
};
|
2022-05-27 18:11:47 +02:00
|
|
|
|
2024-02-12 09:58:49 +01:00
|
|
|
"/data/dirty" = {
|
|
|
|
device = "zdirty";
|
|
|
|
fsType = "zfs";
|
|
|
|
options = ["zfsutil"];
|
|
|
|
};
|
2022-06-06 17:29:26 +02:00
|
|
|
|
2024-02-12 09:58:49 +01:00
|
|
|
"/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"];
|
|
|
|
};
|
2022-06-06 17:29:26 +02:00
|
|
|
};
|
|
|
|
|
2022-05-27 18:11:47 +02:00
|
|
|
# === Swap ===
|
|
|
|
swapDevices = [
|
|
|
|
{device = "/dev/disk/by-uuid/206155f9-6ca0-4d0e-a269-c19766e56902";}
|
|
|
|
];
|
|
|
|
}
|