about summary refs log tree commit diff
path: root/users/sterni/machines/ingeborg/hardware.nix
blob: d1085ebe1c445a78275f0af3b765ab689eca2821 (plain) (blame)
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
{ config, lib, pkgs, depot, ... }:

{
  # Booting / Kernel
  boot = {
    loader.grub = {
      enable = true;
      devices = [
        "/dev/disk/by-id/wwn-0x5000c500a4859731"
        "/dev/disk/by-id/wwn-0x5000c500a485c1b5"
      ];
    };

    initrd = {
      availableKernelModules = [
        "ahci"
        "btrfs"
        "sd_mod"
        "xhci_pci"
        "e1000e"
        "usbhid"
      ];
      kernelModules = [
        "dm-snapshot"
      ];
    };

    swraid = {
      enable = true;
      mdadmConf = ''
        ARRAY /dev/md/boot-raid metadata=1.2 name=nixos:boot-raid UUID=13007b9d:ab7a1129:c45ec40f:3c9f2111
        ARRAY /dev/md/encrypted-container-raid metadata=1.2 name=nixos:encrypted-container-raid UUID=38dfa683:a6d30690:32a5de6f:fb7980fe
      '';
    };

    kernelModules = [
      "kvm-intel"
    ];
  };

  # Filesystems
  services.lvm.enable = true;

  boot.initrd.luks.devices."container" = {
    device = "/dev/md/encrypted-container-raid";
    preLVM = true;
  };

  fileSystems = {
    "/" = {
      device = "/dev/mainvg/root";
      fsType = "btrfs";
    };

    "/boot" = {
      device = "/dev/disk/by-label/boot";
      fsType = "ext4";
    };
  };

  swapDevices = [
    { device = "/dev/mainvg/swap"; }
  ];

  # CPU
  hardware = {
    cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
    enableRedistributableFirmware = true;
  };

  nix.settings = {
    max-jobs = 2;
    cores = 4;
  };

  powerManagement.cpuFreqGovernor = "performance";
}