Skip to content

Instantly share code, notes, and snippets.

@matthewbauer
Last active October 8, 2023 17:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save matthewbauer/68775d50d371eafb0de41a49f81f9cca to your computer and use it in GitHub Desktop.
Save matthewbauer/68775d50d371eafb0de41a49f81f9cca to your computer and use it in GitHub Desktop.
###############################
## Dell XPS 15 9570 (0x087C) ##
###############################
{ config, lib, pkgs, ... }:
{
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.kernelModules = [ "kvm-intel" "i915" ];
boot.kernelParams = [
"mem_sleep_default=deep"
"acpi_rev_override=1" "acpi_osi=Linux"
"pcie_aspm=force"
"drm.vblankoffdelay=1"
"nmi_watchdog=0"
];
boot.blacklistedKernelModules = [ "nouveau" "nv" "rivafb" "nvidiafb" "rivatv" ];
services.xserver.videoDrivers = [ "nvidia" ];
boot.extraModprobeConfig = ''
# options i915 disable_power_well=0 fastboot=1 enable_fbc=1 enable_guc=3 enable_psr=1
options cfg80211 ieee80211_regdom=US
options nouveau modeset=0 nouveau.runpm=0
optinos scsi_mod use_blk_mq=1
'';
nixpkgs.config.allowUnfree = true;
hardware.cpu.intel.updateMicrocode = true;
hardware.nvidia = {
optimus_prime = {
enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
modesetting.enable = true;
};
hardware.firmware = [ pkgs.wireless-regdb ];
services.hardware.bolt.enable = true;
services.fstrim.enable = true;
services.tlp.extraConfig = ''
CPU_SCALING_GOVERNOR_ON_AC=powersave
CPU_SCALING_GOVERNOR_ON_BAT=powersave
USB_AUTOSUSPEND=1
WOL_DISABLE=Y
CPU_BOOST_ON_AC=0
CPU_BOOST_ON_BAT=0
CPU_HWP_ON_AC=balance_performance
CPU_HWP_ON_BAT=balance_power
SOUND_POWER_SAVE_ON_AC=1
'';
environment.systemPackages = [ pkgs.libsmbios ];
hardware.opengl.extraPackages = [
pkgs.vaapiIntel
pkgs.vaapiVdpau
pkgs.libvdpau-va-gl
pkgs.intel-media-driver
];
services.xserver.dpi = 196;
environment.variables."_JAVA_OPTIONS" = "-Dsun.java2d.uiScale=2";
console.earlySetup = true;
console.font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";
networking.networkmanager.wifi.powersave = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment