summaryrefslogtreecommitdiff
path: root/hosts/kansai/hardware-configuration.nix
blob: 9128f0a7c6dd1c327192f0ce740f98187aaf2b14 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
  config,
  lib,
  modulesPath,
  self,
  ...
}:
let
  nixosDevice = "/dev/disk/by-uuid/59148bdd-ecb1-49a0-beec-89d0adf909ae";

  commonOptions = [
    "noatime"
  ];

  commonBtrfsOptions = [
    "compress-force=zstd:1"
    "discard=async"
    "space_cache=v2"
    "ssd"
  ] ++ commonOptions;
in
{
  imports = [
    (modulesPath + "/installer/scan/not-detected.nix")
    (import "${self}/hosts/shared/hardware-configuration.nix")
  ];

  boot = {
    initrd = {
      availableKernelModules = [
        "nvme"
        "xhci_pci"
        "ahci"
        "usb_storage"
        "usbhid"
        "sd_mod"
      ];

      kernelModules = [ ];
    };

    kernelModules = [ "kvm-amd" ];
    extraModulePackages = [ ];
  };

  fileSystems = {
    "/" = {
      device = nixosDevice;
      fsType = "btrfs";
      options = commonBtrfsOptions ++ [ "subvol=@" ];
    };

    "/home" = {
      device = nixosDevice;
      fsType = "btrfs";
      options = commonBtrfsOptions ++ [ "subvol=@home" ];
    };

    "/var" = {
      device = nixosDevice;
      fsType = "btrfs";
      options = commonBtrfsOptions ++ [ "subvol=@var" ];
    };

    "/nix" = {
      device = nixosDevice;
      fsType = "btrfs";
      options = commonBtrfsOptions ++ [ "subvol=@nix" ];
    };

    "/boot" = {
      device = "/dev/disk/by-uuid/C675-43E1";
      fsType = "vfat";

      options = [
        "fmask=0022"
        "dmask=0022"
      ];
    };

    "/mnt/plex" = {
      device = "/dev/mapper/plex";
      fsType = "exfat";

      options = [
        "rw"
        "nofail"
        "uid=1000"
        "gid=1000"
        "dmask=027"
        "fmask=137"
      ] ++ commonOptions;
    };
  };

  swapDevices = [ ];
  networking.useDHCP = lib.mkDefault true;
  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}