From 61920f27c559f6239472c0a02d08067de2435873 Mon Sep 17 00:00:00 2001 From: cnst Date: Sun, 18 Aug 2024 20:55:44 +0200 Subject: [PATCH] changes to nvidia module and some toothpick environment changes --- .../devtools/neovim/plugins/default.nix | 2 +- home/users/toothpick/default.nix | 10 ++++------ hosts/toothpc/modules.nix | 7 +++++-- .../hardware/graphics/nvidia/default.nix | 18 ++++++++++++++---- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/home/modules/devtools/neovim/plugins/default.nix b/home/modules/devtools/neovim/plugins/default.nix index 71bff150..c9973405 100644 --- a/home/modules/devtools/neovim/plugins/default.nix +++ b/home/modules/devtools/neovim/plugins/default.nix @@ -13,7 +13,7 @@ ./tagbar.nix ./telescope.nix ./treesitter.nix - ./chatgpt.nix + # ./chatgpt.nix # ./vimtex.nix ./nonels.nix ./conform.nix diff --git a/home/users/toothpick/default.nix b/home/users/toothpick/default.nix index 573ed1fe..3a43e773 100644 --- a/home/users/toothpick/default.nix +++ b/home/users/toothpick/default.nix @@ -21,13 +21,11 @@ TERM = "foot"; STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/toothpick/.steam/root/compatibilitytools.d"; # proton and steam compat - XDG_SESSION_TYPE = "wayland"; - MOZ_ENABLE_WAYLAND = "1"; - MOZ_DISABLE_RDD_SANDBOX = "1"; - WLR_DRM_NO_ATOMIC = "1"; - WLR_NO_HARDWARE_CURSORS = "1"; LIBVA_DRIVER_NAME = "nvidia"; - EGL_PLATFORM = "wayland"; + XDG_SESSION_TYPE = "wayland"; + # GBM_BACKEND = "nvidia-drm"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + NVD_BACKEND = "direct"; }; }; # disable manuals as nmd fails to build often diff --git a/hosts/toothpc/modules.nix b/hosts/toothpc/modules.nix index ec166a7a..32a1ff4b 100644 --- a/hosts/toothpc/modules.nix +++ b/hosts/toothpc/modules.nix @@ -18,7 +18,10 @@ logitech.enable = true; graphics = { amd.enable = false; - nvidia.enable = true; + nvidia = { + enable = true; + package = "stable"; # set to stable or beta depending on preference + }; }; }; network = { @@ -61,7 +64,7 @@ utils = { android.enable = true; anyrun.enable = true; - corectrl.enable = true; + corectrl.enable = false; microfetch.enable = true; nix-ld.enable = false; }; diff --git a/system/modules/hardware/graphics/nvidia/default.nix b/system/modules/hardware/graphics/nvidia/default.nix index c428e063..73633cb3 100644 --- a/system/modules/hardware/graphics/nvidia/default.nix +++ b/system/modules/hardware/graphics/nvidia/default.nix @@ -4,12 +4,20 @@ lib, ... }: let - inherit (lib) mkIf mkEnableOption; + inherit (lib) types mkIf mkEnableOption mkOption; cfg = config.modules.hardware.graphics.nvidia; in { options = { - modules.hardware.graphics.nvidia.enable = mkEnableOption "Enables NVidia graphics"; + modules.hardware.graphics.nvidia = { + enable = mkEnableOption "Enables NVidia graphics"; + package = mkOption { + type = types.enum ["stable" "beta"]; + default = "stable"; + description = "Choose between the stable or beta NVidia driver package"; + }; + }; }; + config = mkIf cfg.enable { hardware = { graphics = { @@ -24,8 +32,10 @@ in { ]; }; nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.beta; - # package = config.boot.kernelPackages.nvidiaPackages.stable; + package = + if cfg.package == "beta" + then config.boot.kernelPackages.nvidiaPackages.beta + else config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; powerManagement = { enable = false;