summaryrefslogtreecommitdiff
path: root/nixos/modules/system/boot/default.nix
blob: eedf9399f5b688871f371180fd0bed62f1b39c3f (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
{ config, pkgs, lib, modulesPath, ... }:

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

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

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

  # EDID firmware loading is kept here because it's a kernel-level boot concern.
  # Commented kernel params from the original config are preserved.
  # boot.kernelParams = [
  #   "drm.edid_firmware=DP-1:edid/mi_edid.bin"
  #   "video=DP-1:2560x1440@180"
  # ];
  hardware.firmware = [
    (pkgs.runCommand "custom-edid" {} ''
      mkdir -p $out/lib/firmware/edid
      cp ${../../../mi_edid.bin} $out/lib/firmware/edid/mi_edid.bin
    '')
  ];

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