summaryrefslogtreecommitdiff
path: root/odin/hw.nix
blob: a0af42a6a8d5ddff1715032aebb2c0e42386d0bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:

{
  imports =
    [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
    ];

  boot.initrd = {
    availableKernelModules = [
      "uhci_hcd" "ehci_pci" "xhci_pci"
      "pata_marvell" "nvme" "firewire_ohci" "usb_storage" "usbhid"
      "sd_mod" "r8169" "mpt3sas"
      "dm-snapshot" "dm-integrity" "dm-raid" "drbg" "authenc"
      "fbcon" "rtsx_pci_sdmmc" 
      "cryptd" "crypto-simd"
      "essiv" "authenc"
    ];
    kernelModules = [ "dm-raid" "dm-crypt" "ahci" "sd" "ata_piix" ];
    luks.devices = {
      raid6 = {
        device = "/dev/disk/by-uuid/1a552384-4f74-40bf-a5cf-961ea24c339e";
      };
      ssd-raid1 = {
        device = "/dev/disk/by-uuid/f348a104-4774-47b3-a241-b7eaca0080e3";
      };
      ssd-nvme = {
        device = "/dev/disk/by-uuid/fdd3f054-edee-42d5-aa82-08e3477014f3";
        allowDiscards = true;
      };
    };

    mdadmConf = ''
      ARRAY /dev/md/isaac:raid6 metadata=1.2 name=isaac:raid6 UUID=42f7a827:e1c05dfe:7e7977dc:ccf1a569
      ARRAY /dev/md1 metadata=1.2 name=localhost:ssd-raid1 UUID=f2e398f9:e2d4d8ce:b1811e05:584bf759
      ARRAY /dev/md0 metadata=1.2 name=localhost:boot UUID=a56bdcef:a622dd3a:c6af3832:591a8bb3
    '';
  };

  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/ssd-raid1/root";
      fsType = "ext4";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/f6b49ce4-536c-4470-ad22-2af5c2b53d61";
      fsType = "ext4";
    };

  fileSystems."/srv/hlidskjalf" =
    { device = "/dev/raid6/hlidskjalf";
      fsType = "ext4";
    };

  fileSystems."/srv/git" =
    { device = "/dev/raid6/git";
      fsType = "ext4";
    };

  fileSystems."/home" =
    { device = "/dev/raid6/home";
      fsType = "ext4";
      options = [ "defaults" "quota" ];
    };

  fileSystems."/root" =
    { device = "/dev/raid6/root";
      fsType = "ext4";
    };

  fileSystems."/srv/media" =
    { device = "/dev/raid6/media";
      fsType = "ext4";
    };

  fileSystems."/srv/mail" =
    { device = "/dev/raid6/mail";
      fsType = "ext4";
    };

  fileSystems."/nix/store" =
    { device = "/dev/ssd-nvme/nix-store";
      fsType = "xfs";
    };

  fileSystems."/var/spool" =
    { device = "/dev/raid6/spool";
      fsType = "xfs";
    };

  fileSystems."/scratch" =
    { device = "/dev/raid6/scratch";
      fsType = "ext4";
    };

  swapDevices =
    [ { device = "/dev/ssd-raid1/swap"; }
    ];

  nix.maxJobs = lib.mkDefault 8;
}