From 65bac6adafd1d3b60a49ff6fece2009014f814c5 Mon Sep 17 00:00:00 2001 From: Nettika Date: Tue, 11 Jun 2024 14:56:53 -0700 Subject: [PATCH] Inline settings from nixos-hardware for the ASUS ROG Strix G513 --- configuration.nix | 2 -- hardware.nix | 25 ++++++++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/configuration.nix b/configuration.nix index ead0ef3..11d4e7d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,7 +1,6 @@ { config, lib, pkgs, ... }: { imports = [ - ./hardware.nix ./networking.nix ./users.nix @@ -23,7 +22,6 @@ services.xserver = { enable = true; - #videoDrivers = ["nvidia" "amdgpu"]; desktopManager = { cinnamon.enable = true; xterm.enable = false; diff --git a/hardware.nix b/hardware.nix index d1fa33f..f824da6 100644 --- a/hardware.nix +++ b/hardware.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { boot = { loader = { @@ -13,7 +13,7 @@ "sd_mod" ]; kernelModules = ["kvm-amd"]; - # kernelParams = ["amd_pstate=active"]; + kernelParams = ["amd_pstate=active"]; }; fileSystems = { @@ -29,17 +29,28 @@ }; nixpkgs.hostPlatform = "x86_64-linux"; - + hardware = { enableRedistributableFirmware = true; cpu.amd.updateMicrocode = true; opengl = { enable = true; driSupport32Bit = true; + extraPackages = [pkgs.vaapiVdpau]; }; - # nvidia.prime = { - # amdgpuBusId = "PCI:05:00:0"; - # nvidiaBusId = "PCI:01:00:0"; - # }; + nvidia.prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + amdgpuBusId = "PCI:05:00:0"; + nvidiaBusId = "PCI:01:00:0"; + }; + }; + + services = { + xserver.videoDrivers = ["nvidia"]; + tlp.enable = true; + fstrim.enable = true; }; }