From 8abdc7eaaf878f42e95cb77826f3f83f7450b3e2 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Mon, 29 Apr 2024 22:51:53 +0200 Subject: [PATCH] move the nvidia hardware code --- hosts/default/configuration.nix | 1 - hosts/default/hardware-configuration.nix | 23 +++++++++++++++++++++ hosts/default/nvidia.nix | 26 ------------------------ 3 files changed, 23 insertions(+), 27 deletions(-) delete mode 100644 hosts/default/nvidia.nix diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 2bcdc1f..cd6e693 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -8,7 +8,6 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ./nvidia.nix inputs.home-manager.nixosModules.default ]; diff --git a/hosts/default/hardware-configuration.nix b/hosts/default/hardware-configuration.nix index 17ffb75..c219d06 100644 --- a/hosts/default/hardware-configuration.nix +++ b/hosts/default/hardware-configuration.nix @@ -34,4 +34,27 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.opengl = { + enable = true; + driSupport = true; + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + modesetting.enable = true; + + # NOTE change this if borked + powerManagement = { + enable = false; + finegrained = false; + }; + + open = false; + + nvidiaSettings = true; + + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; } diff --git a/hosts/default/nvidia.nix b/hosts/default/nvidia.nix deleted file mode 100644 index a4d0050..0000000 --- a/hosts/default/nvidia.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - hardware.opengl = { - enable = true; - driSupport = false; - }; - - services.xserver.videoDrivers = [ "nvidia" ]; - - hardware.nvidia = { - - modesetting.enable = true; - - # NOTE change this if borked - powerManagement = { - enable = false; - finegrained = false; - }; - - open = false; - - nvidiaSettings = true; - - package = config.boot.kernelPackages.nvidiaPackages.stable; - }; -}