Skip to content

Instantly share code, notes, and snippets.

@adrianparvino
Created January 24, 2020 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianparvino/9ee88c7b464ff7200e27b86a0c24ac22 to your computer and use it in GitHub Desktop.
Save adrianparvino/9ee88c7b464ff7200e27b86a0c24ac22 to your computer and use it in GitHub Desktop.
{ config, pkgs, lib, ... }:
{
boot = {
loader = {
systemd-boot.enable = true;
timeout = 2;
efi.canTouchEfiVariables = true;
};
extraModprobeConfig = ''
options iwlwifi power_save=1
options iwlwifi uapsd_disable=0
options iwlwifi d0i3_disable=0
'';
# blacklistedKernelModules = [ "uvcvideo" ];
};
hardware.cpu.intel.updateMicrocode = true;
nesting.clone = [{
hardware.nvidiaOptimus.disable = lib.mkForce false;
hardware.nvidia.modesetting.enable = true;
hardware.nvidia.prime = {
sync.enable = true;
nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0";
};
services.xserver = {
videoDrivers = [ "nvidiaBeta" ];
deviceSection = ''
Option "Coolbits" "28"
'';
};
}];
hardware.nvidiaOptimus.disable = true;
# hardware.nvidia.optimus_prime = {
# enable = true;
# nvidiaBusId = "PCI:1:0:0";
# intelBusId = "PCI:0:2:0";
# };
networking = {
dhcpcd.enable = false;
interfaces.wlp2s0.ipv4.addresses = [{
address = "192.168.2.103";
prefixLength = 24;
}];
};
services = {
tlp.enable = true;
undervolt = {
enable = true;
coreOffset = "-95";
uncoreOffset = "-105";
analogioOffset = "-105";
gpuOffset = "-95";
};
};
# hardware.bumblebee.enable = true;
systemd.services.tdp8550u = {
path = with pkgs; [ msr-tools devmem2 ];
wantedBy = [ "undervolt.service" ];
requiredBy = [ "undervolt.service" ];
serviceConfig = {
Type = "oneshot";
Restart = "no";
};
script = ''
wrmsr 0x610 0x42819800FC80C0
devmem2 0xFED159A0 w 0x00DD80C0
# All core 40x boost
wrmsr 0x1AD 0x28282828
'';
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment