Nvidia, add option to use stable drivers
This commit is contained in:
parent
29c2b1ce80
commit
544bb630a0
2 changed files with 10 additions and 7 deletions
|
|
@ -4,7 +4,10 @@
|
||||||
imports = [
|
imports = [
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
nvidia.enable = true;
|
nvidia = {
|
||||||
|
enable = true;
|
||||||
|
stable = true;
|
||||||
|
};
|
||||||
pipewire.enable = true;
|
pipewire.enable = true;
|
||||||
polkit.enable = true;
|
polkit.enable = true;
|
||||||
tablet.enable = true;
|
tablet.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -2,22 +2,22 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
options.nvidia = {
|
options.nvidia = {
|
||||||
enable = lib.mkEnableOption
|
enable = lib.mkEnableOption "Enables nvidia with proprietary drivers";
|
||||||
"Enables nvidia with proprietary drivers";
|
|
||||||
open = lib.mkEnableOption "Use open nvidia option for newer cards";
|
open = lib.mkEnableOption "Use open nvidia option for newer cards";
|
||||||
|
stable = lib.mkEnableOption "Use stable instead of beta";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.nvidia.enable {
|
config = lib.mkIf config.nvidia.enable {
|
||||||
hardware.graphics = {
|
hardware.graphics.enable = true;
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
services.xserver.videoDrivers = ["nvidia"];
|
||||||
|
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
open = if config.nvidia.open then true else false;
|
open = if config.nvidia.open then true else false;
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
package = if config.nvidia.stable
|
||||||
|
then config.boot.kernelPackages.nvidiaPackages.stable
|
||||||
|
else config.boot.kernelPackages.nvidiaPackages.beta;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.kernelParams = [ "nvidia_drm.fbdev=1" ];
|
boot.kernelParams = [ "nvidia_drm.fbdev=1" ];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue