| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- { inputs, lib, ... }:
- let
- disks = {
- parity1 = "ata-ST8000VN002-2ZM188_WPV023WG";
- data1 = "ata-ST8000VN002-2ZM188_WPV07RMA";
- data2 = "ata-ST8000VN002-2ZM188_WPV020CG";
- };
- in
- {
- imports = [
- inputs.disko.nixosModules.disko
- ];
- disko.devices = {
- disk = {
- # Root system drive (1TB NVMe)
- main = {
- type = "disk";
- device = "/dev/disk/by-id/nvme-KINGSTON_SNV3S1000G_50026B7383CC0908";
- content = {
- type = "gpt";
- partitions = {
- # EFI boot partition
- efi = {
- size = "1G";
- type = "EF00";
- content = {
- type = "filesystem";
- format = "vfat";
- mountpoint = "/boot";
- };
- };
- # Main Btrfs partition
- root = {
- end = "-0";
- content = {
- type = "btrfs";
- extraArgs = [ "-f" ];
- subvolumes = {
- "@root" = {
- mountpoint = "/";
- mountOptions = [ "compress=zstd1" "noatime" ];
- };
- "@nix" = {
- mountpoint = "/nix";
- mountOptions = [ "compress=zstd1" "noatime" ];
- };
- "@persist" = {
- mountpoint = "/persist";
- mountOptions = [ "compress=zstd1" "noatime" ];
- };
- "@services" = {
- mountpoint = "/var/lib";
- mountOptions = [ "compress=zstd1" "noatime" "space_cache=v2" ];
- };
- "@logs" = {
- mountpoint = "/var/log";
- mountOptions = [ "compress=zstd1" "noatime" ];
- };
- };
- };
- };
- };
- };
- };
- } // lib.attrsets.mapAttrs
- (name: value: {
- type = "disk";
- device = "/dev/disk/by-id/${value}";
- content = {
- type = "gpt";
- partitions = {
- primary = {
- size = "100%";
- content = {
- type = "filesystem";
- format = "xfs";
- mountpoint = "/mnt/${name}";
- mountOptions = [ "defaults" "noatime" ];
- };
- };
- };
- };
- })
- disks;
- };
- }
|