summaryrefslogtreecommitdiff
path: root/mini/hardware-configuration.nix
blob: ed48edd156316e391bd1453847b55254a9a5f736 (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
# 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, modulesPath, ... }:

{
  imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

  boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ];
  boot.initrd.kernelModules = [ "amdgpu" ];
  boot.kernelModules = [ "kvm-amd" ];

  # /boot efi partition to boot in UEFI mode
  fileSystems."/boot" =
    { device = "/dev/disk/by-id/nvme-CT4000P3PSSD8_2325E6E63746-part1";
      fsType = "vfat";
      options = [ "fmask=0022" "dmask=0022" ];
      neededForBoot = true;
    };

  # /nix encrypted btrfs for the remaining space
  boot.initrd.luks.devices."crypt0" = {
    device = "/dev/disk/by-id/nvme-CT4000P3PSSD8_2325E6E63746-part2";
    allowDiscards = true;
    bypassWorkqueues = true;
  };
  boot.initrd.luks.devices."crypt1" = {
    device = "/dev/disk/by-id/ata-CT2000MX500SSD1_2138E5D5061F";
    allowDiscards = true;
    bypassWorkqueues = true;
  };
  fileSystems."/nix" =
    { device = "/dev/mapper/crypt0";
      fsType = "btrfs";
      options = [ "device=/dev/mapper/crypt1" ];
      neededForBoot = true;
    };

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

  # amd graphics
  hardware.graphics.extraPackages = with pkgs; [ amdvlk rocm-opencl-icd rocm-opencl-runtime ];
}