{ pkgs, ... }:
let
  kernel = pkgs.linuxPackages_cachyos;
in
{
  # Configure bootloader with lanzaboot and secureboot
  boot = {
    consoleLogLevel = 0;
    initrd.verbose = false;
    kernelModules = [ "nct6775" ];
    # loader = {
    #   systemd-boot = {
    #     enable = false;
    #     configurationLimit = 5;
    #     extraInstallCommands = ''
    #       ${lib.getExe' pkgs.uutils-coreutils "uutils-echo"} "timeout 0
    #       console-mode 1
    #       default nixos-*" > /boot/loader/loader.conf
    #     '';
    #   };

    #   efi = {
    #     canTouchEfiVariables = true;
    #     efiSysMountPoint = "/boot";
    #   };
    # };

    lanzaboote = {
      settings = {
        console-mode = "max";
        timeout = "0";
      };
    };

    plymouth = {
      enable = true;
    };

    kernelPackages = kernel;

    kernelParams = [
      "quiet"
      "amdgpu.ppfeaturemask=0xffffffff"
      "splash"
      "rd.systemd.show_status=false"
      "rd.udev.log_level=3"
      "udev.log_priority=3"
      "loglevel=0"
      "vt.global_cursor_default=0"
      "rd.shell=0"
      # Disable audit messages
      "audit=0"
      # Disable CPU mitigations messages
      "mitigations=off"
    ];

    bootspec.enable = true;
  };

  # Further reduce systemd output
  systemd = {
    services.systemd-udev-settle.enable = false;
  };
}
