summaryrefslogtreecommitdiff
path: root/systems/glados/boot.nix
blob: d68b32ce1f2d67914399bb2c020c82cb93f1f1c6 (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
{
  config,
  lib,
  pkgs,
  inputs,
  ...
}:
{
  imports = [ inputs.lanzaboote.nixosModules.lanzaboote ];

  environment.systemPackages = [
    # manual lanzaboote maintenance (NOTE: i have not actually used this since ~2022)
    pkgs.sbctl
    # TODO: is this actually required for using `tpm2-device=auto` to unlock LUKS volumes in initrd? probably
    pkgs.tpm2-tss
  ];

  boot = {
    initrd.systemd.enable = true; # for unlocking luks root with tpm2

    kernelPackages = pkgs.linuxKernel.packages.linux_6_11;

    kernelParams =
      [
        "amd_pstate=active"
      ]
      # Don't use GSP Firmware on proprietary driver
      # https://github.com/NVIDIA/open-gpu-kernel-modules/issues/693
      ++ lib.optional (!config.hardware.nvidia.open) "nvidia.NVreg_EnableGpuFirmware=0";

    loader.systemd-boot.enable = lib.mkForce false; # lanzaboote replaces this

    lanzaboote = {
      enable = true;

      pkiBundle = "/etc/secureboot";

      settings = {
        console-mode = "auto";
        editor = false;
        timeout = 0;
      };
    };

    supportedFilesystems = [ "ntfs" ]; # for game drive
  };
}