From 405ac4ab73f6856102e6fd3c825b5540281c3034 Mon Sep 17 00:00:00 2001 From: workflow <4farlion@gmail.com> Date: Tue, 15 Oct 2024 15:41:26 +0100 Subject: [PATCH] refac(gpu): move nvidia-specific settings to nvidia module --- configuration.nix | 1 - flake.nix | 2 ++ home/picom.nix | 5 ----- machines/boar/system.nix | 3 --- machines/flexbox/system.nix | 1 - system/gpu.nix | 3 --- system/nvidia/default.nix | 7 +++++++ system/video/default.nix | 1 - 8 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 system/gpu.nix create mode 100644 system/nvidia/default.nix diff --git a/configuration.nix b/configuration.nix index 90964ca..ba7e235 100644 --- a/configuration.nix +++ b/configuration.nix @@ -16,7 +16,6 @@ in { ./system/desktop.nix ./system/dns.nix ./system/fonts.nix - ./system/gpu.nix ./system/io ./system/ledgerlive.nix ./system/networking.nix diff --git a/flake.nix b/flake.nix index 5fffb55..7656929 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,7 @@ nixpkgs.nixosModules.notDetected ./machines/boar/hardware-scan.nix ./machines/boar/system.nix + ./system/nvidia ./configuration.nix home-manager.nixosModules.home-manager { @@ -99,6 +100,7 @@ nixpkgs.nixosModules.notDetected ./machines/flexbox/hardware-scan.nix ./machines/flexbox/system.nix + ./system/nvidia ./configuration.nix home-manager.nixosModules.home-manager { diff --git a/home/picom.nix b/home/picom.nix index 3f2204a..637ac04 100644 --- a/home/picom.nix +++ b/home/picom.nix @@ -5,11 +5,6 @@ enable = true; - # For NVIDIA, we can run with the simpler xrender backend, - # which does not do vsync - # Note: This may also need ForceFullCompositionPipeline in xorg.conf - # See: https://github.com/chjj/compton/issues/227 - # backend = if isNvidia then "xrender" else "glx"; backend = "glx"; settings = { diff --git a/machines/boar/system.nix b/machines/boar/system.nix index 88a730e..5322420 100644 --- a/machines/boar/system.nix +++ b/machines/boar/system.nix @@ -30,9 +30,6 @@ powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; - # GPU - services.xserver.videoDrivers = ["nvidia"]; - # LVM on LUKS boot.initrd.luks.devices = { root = { diff --git a/machines/flexbox/system.nix b/machines/flexbox/system.nix index 05c91cd..d4894ae 100644 --- a/machines/flexbox/system.nix +++ b/machines/flexbox/system.nix @@ -20,7 +20,6 @@ in { # GPU environment.systemPackages = [nvidia-offload]; - services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia.prime = { offload.enable = true; intelBusId = "PCI:0:2:0"; diff --git a/system/gpu.nix b/system/gpu.nix deleted file mode 100644 index 44110a7..0000000 --- a/system/gpu.nix +++ /dev/null @@ -1,3 +0,0 @@ -{pkgs, ...}: { - boot.blacklistedKernelModules = ["nouveau"]; -} diff --git a/system/nvidia/default.nix b/system/nvidia/default.nix new file mode 100644 index 0000000..1db143e --- /dev/null +++ b/system/nvidia/default.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + boot.blacklistedKernelModules = ["nouveau"]; + environment.systemPackages = [ + pkgs.nvtopPackages.full # nvtop + ]; + services.xserver.videoDrivers = ["nvidia"]; +} diff --git a/system/video/default.nix b/system/video/default.nix index 76915cc..3c808f7 100644 --- a/system/video/default.nix +++ b/system/video/default.nix @@ -12,7 +12,6 @@ boot.kernelModules = ["v4l2loopback"]; environment.systemPackages = [ - pkgs.nvtopPackages.full # nvtop pkgs.v4l-utils # Video4Linux2 -> configuring webcam ]; }