try to make nvidia module toogleable

This commit is contained in:
smayzy 2025-07-05 13:03:23 +02:00
parent 02b4a97957
commit 22af8932ee
2 changed files with 19 additions and 6 deletions

View File

@ -9,6 +9,8 @@
../../modules/nix/virt.nix ../../modules/nix/virt.nix
]; ];
smayzy.nvidia.enable = true;
home-manager = { home-manager = {
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = { inherit inputs; };
users = { users = {

View File

@ -1,10 +1,21 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkOption types;
in
{ {
services.xserver.videoDrivers = [ "nvidia" ]; options.smayzy.nvidia.enable = mkOption {
hardware.nvidia = { type = types.bool;
modesetting.enable = true; default = false;
open = true; description = "set to true if you want to use a nvidia GC";
nvidiaSettings = true; };
package = config.boot.kernelPackages.nvidiaPackages.stable;
config = mkIf config.smayzy.nvidia.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
}; };
} }