{ config, pkgs, ... }:

{

  imports = [
    ./hardware-configuration.nix
  ];

  system.nixos.tags = [ "Nya_Beginnings" ];

  services.resolved = {
    enable = true;
    dnsovertls = "opportunistic";
    fallbackDns = [
      "2620:fe::10#dns10.quad9.net"
      "2620:fe::fe:10#dns10.quad9.net"
      "9.9.9.10#dns10.quad9.net"
      "149.112.112.10#dns10.quad9.net"
    ];
    extraConfig = ''
      DNS=2620:fe::10#dns10.quad9.net 2620:fe::fe:10#dns10.quad9.net 9.9.9.10#dns10.quad9.net 149.112.112.10#dns10.quad9.net
    '';
  };
  networking = {
    hostName = "lappy"; 
    networkmanager.enable = true; 
  };
  time.timeZone = "America/Lost_Angeles";

  boot.kernelParams = [
    "intel_pstate=no_hwp"
    "kernel.yama.ptrace_scope=0"
    "mem_sleep_default=deep"
    "module_blacklist=hid_sensor_hub"
    "intel_iommu=on"
    "iommu=pt"
    "i915.enable_guc=7"
  ];

  hardware.opengl = {
    enable = true;
    driSupport = true;
    driSupport32Bit = true;
    extraPackages = with pkgs; [
      intel-compute-runtime
      intel-media-driver
    ];
  };

  systemd.extraConfig = 
    "AllowedCPUs=8-15"
  ;

  services.tlp = {
      enable = true;
      settings = {

        TLP_DEFAULT_MODE = "BAT";
        TLP_PERSISTENT_DEFAULT = 1;

        CPU_SCALING_GOVERNOR_ON_BAT = "schedutil";
        CPU_ENERGY_PERF_POLICY_ON_BAT = "power";


        CPU_MIN_PERF_ON_AC = 0;
        CPU_MAX_PERF_ON_AC = 100;
        CPU_MIN_PERF_ON_BAT = 0;
        CPU_MAX_PERF_ON_BAT = 30;

       #Optional helps save long term battery health
       START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge
       STOP_CHARGE_THRESH_BAT0 = 90; # 80 and above it stops charging

      };
};


  # Read the Docs before Changing
  system.stateVersion = "23.05";
}