summaryrefslogtreecommitdiff
path: root/hosts/shinji/hardware.nix
blob: f1edca2039fd15e4ca94949b41cdc457052e6ecc (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
{
  config,
  inputs,
  ...
}: {
  # external defaults
  imports = [
    inputs.nixos-hardware.nixosModules.lenovo-yoga-7-slim-gen8
  ];

  # bootloader
  boot.loader = {
    efi.canTouchEfiVariables = true;
    grub = {
      enable = true;
      efiSupport = true;
      device = "nodev";
      splashImage = config.theme.wallpaper;
    };
  };

  # kernel modules
  boot.initrd.availableKernelModules = [
    "nvme"
    "xhci_pci"
    "thunderbolt"
    "usb_storage"
    "sd_mod"
  ];
  boot.initrd.kernelModules = [
    "vfio_pci"
    "vfio"
    "vfio_iommu_type1"
  ];
  boot.kernelModules = ["kvm-amd"];
  boot.blacklistedKernelModules = ["nouveau"];
  boot.kernelParams = [
    "amd_iommu=on"
  ];
  boot.extraModulePackages = [];
  boot.supportedFilesystems = ["ntfs"];

  # supress annoying acpi error msgs
  boot.consoleLogLevel = 2;

  # firmware
  hardware.enableRedistributableFirmware = true;
  hardware.cpu.amd.updateMicrocode = true;

  # luks device
  boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/ad489bfa-4280-44ea-8ad2-60347b516d60";
  boot.initrd.luks.devices."swap".device = "/dev/disk/by-uuid/550e638d-eade-4d2f-aa39-c38774c91af3";

  # root
  fileSystems."/" = {
    device = "/dev/disk/by-uuid/b43a7cf6-b9aa-44c2-ad29-da24ffa56901";
    fsType = "btrfs";
  };

  # boot
  fileSystems."/boot" = {
    device = "/dev/disk/by-uuid/6F93-6A0B";
    fsType = "vfat";
    options = ["fmask=0022" "dmask=0022"];
  };

  # swap
  swapDevices = [
    {device = "/dev/disk/by-uuid/8a7ce615-f5c0-4b0c-a9a5-bddf2d6c2ab0";}
  ];
}