2024-01-29 23:07:13 -05:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
|
|
imports =
|
|
|
|
[
|
|
|
|
<nixos-hardware/microsoft/surface/common>
|
|
|
|
];
|
|
|
|
|
|
|
|
##### SB3 Hardware #####
|
|
|
|
# surface kernel config
|
|
|
|
users.users.caleb.extraGroups = [ "surface-control" ];
|
|
|
|
microsoft-surface.surface-control.enable = true;
|
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
|
|
|
|
|
|
|
# Nvidia driver setup
|
|
|
|
hardware.nvidia = {
|
|
|
|
modesetting.enable = true;
|
2024-05-05 18:53:07 -04:00
|
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
2024-01-29 23:07:13 -05:00
|
|
|
nvidiaSettings = true;
|
|
|
|
powerManagement = {
|
|
|
|
enable = true;
|
|
|
|
finegrained = true;
|
|
|
|
};
|
2024-02-06 17:05:01 -05:00
|
|
|
nvidiaPersistenced = true;
|
2024-01-29 23:07:13 -05:00
|
|
|
prime = {
|
|
|
|
offload = {
|
|
|
|
enable = true;
|
|
|
|
enableOffloadCmd = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
intelBusId = "PCI:0:2:0";
|
|
|
|
nvidiaBusId = "PCI:2:0:0";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-06 17:05:01 -05:00
|
|
|
# preserve video memory after suspend https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend
|
2024-02-07 11:53:36 -05:00
|
|
|
boot.extraModprobeConfig = ''
|
|
|
|
options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp
|
|
|
|
'';
|
2024-02-29 19:19:18 -05:00
|
|
|
|
|
|
|
# change backlight agent
|
|
|
|
boot.kernelParams = [ "acpi_osi=!" "acpi_osi=\"Windows 2015\""];
|
2024-01-29 23:07:13 -05:00
|
|
|
}
|