74 lines
2.1 KiB
Nix
74 lines
2.1 KiB
Nix
{ den, inputs, lib, config, ... }: {
|
|
den.aspects.work-specific.nixos = { pkgs, config, ... }: {
|
|
imports = [
|
|
./_hardware/work-hardware.nix
|
|
];
|
|
|
|
hardware = {
|
|
graphics = {
|
|
enable = true;
|
|
enable32Bit = true;
|
|
};
|
|
|
|
nvidia = {
|
|
modesetting.enable = true;
|
|
open = false;
|
|
nvidiaSettings = true;
|
|
powerManagement.enable = true;
|
|
powerManagement.finegrained = true;
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
# AMD iGPU drives the display; NVIDIA dGPU handles offloaded rendering.
|
|
# Run `lspci -D | grep -E '(VGA|3D|Display)'` to verify Bus IDs.
|
|
prime = {
|
|
offload.enable = true;
|
|
offload.enableOffloadCmd = true;
|
|
amdgpuBusId = "PCI:5:0:0";
|
|
nvidiaBusId = "PCI:1:0:0";
|
|
};
|
|
};
|
|
};
|
|
|
|
services.xserver.videoDrivers = [ "amdgpu" "nvidia" ];
|
|
|
|
environment.sessionVariables = {
|
|
GBM_BACKEND = "nvidia-drm";
|
|
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
|
};
|
|
|
|
security.sudo.wheelNeedsPassword = lib.mkForce true;
|
|
|
|
networking.firewall = {
|
|
enable = true;
|
|
allowedTCPPorts = [];
|
|
allowedUDPPorts = [];
|
|
};
|
|
|
|
powerManagement.enable = true;
|
|
|
|
services.tlp = {
|
|
enable = true;
|
|
settings = {
|
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
|
};
|
|
};
|
|
|
|
boot = {
|
|
initrd.kernelModules = [ "amdgpu" ];
|
|
kernelModules = [ "kvm-amd" "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
|
|
initrd.compressor = "zstd";
|
|
kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
|
|
|
|
loader = {
|
|
grub = {
|
|
enable = true;
|
|
device = "nodev";
|
|
efiSupport = true;
|
|
efiInstallAsRemovable = true;
|
|
configurationLimit = 10;
|
|
};
|
|
efi.canTouchEfiVariables = false;
|
|
};
|
|
};
|
|
};
|
|
}
|