# 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,
  modulesPath,
  pkgs,
  ...
}: {
  imports = [
    (modulesPath + "/hardware/cpu/intel-npu.nix")
    (modulesPath + "/installer/scan/not-detected.nix")
  ];

  boot = {
    kernelPackages = pkgs.linuxPackages_latest;
    kernelModules = [
      "imx471"
      "kvm-intel"
      "v4l2loopback"
    ];
    extraModulePackages = with pkgs.linuxPackages_latest; [
      imx471
      v4l2loopback
    ];
    extraModprobeConfig = ''
      options v4l2loopback devices=1 video_nr=0 card_label="IMX471 Virtual Camera" exclusive_caps=1
    '';

    initrd = {
      availableKernelModules = [
        "nvme"
        "sd_mod"
        "thunderbolt"
        "usb_storage"
        "xhci_pci"
      ];
      kernelModules = [];
    };
  };

  services.logind.settings.Login.HandleLidSwitchExternalPower = "ignore";

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.intel = {
    npu.enable = true;
    updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
  };
}
