| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- { 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;
- };
- }
|