diff --git a/hosts/madara/configuration.nix b/hosts/madara/configuration.nix index 4e10a1f..3a8c74c 100644 --- a/hosts/madara/configuration.nix +++ b/hosts/madara/configuration.nix @@ -19,7 +19,7 @@ in }; hardware.nvidia = { nvidiaSettings = false; - package = config.boot.kernelPackages.nvidiaPackages.beta; + # package = config.boot.kernelPackages.nvidiaPackages.beta; }; yubikey.signing = "sanemi"; runners.YASF.enable = true; diff --git a/hosts/madara/default.nix b/hosts/madara/default.nix index 081adb2..d516773 100644 --- a/hosts/madara/default.nix +++ b/hosts/madara/default.nix @@ -1,6 +1,9 @@ { inputs, ... }: { imports = [ + (inputs.nixos-hardware.outPath + "/common/cpu/intel/coffee-lake") + (inputs.nixos-hardware.outPath + "/common/gpu/nvidia/pascal") + ./configuration.nix ./hardware-configuration.nix diff --git a/hosts/yhwach/default.nix b/hosts/yhwach/default.nix index 081adb2..d516773 100644 --- a/hosts/yhwach/default.nix +++ b/hosts/yhwach/default.nix @@ -1,6 +1,9 @@ { inputs, ... }: { imports = [ + (inputs.nixos-hardware.outPath + "/common/cpu/intel/coffee-lake") + (inputs.nixos-hardware.outPath + "/common/gpu/nvidia/pascal") + ./configuration.nix ./hardware-configuration.nix diff --git a/modules/nixos/system/nvidia/default.nix b/modules/nixos/system/nvidia/default.nix index ade6742..112d5a3 100644 --- a/modules/nixos/system/nvidia/default.nix +++ b/modules/nixos/system/nvidia/default.nix @@ -8,49 +8,29 @@ options.hosts.nvidia.enable = lib.mkEnableOption "Setup Nvidia environment"; config = lib.mkIf config.hosts.nvidia.enable { - boot = { - kernelPackages = pkgs.linuxPackages; - # kernelParams = [ "nvidia.NVreg_EnableGpuFirmware=0" ]; - }; + # Latest kernel does not work well with some web browsers... + boot.kernelPackages = pkgs.linuxPackages; - # Load nvidia driver for Xorg and Wayland - services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; + # boot = { + # kernelParams = [ "nvidia.NVreg_EnableGpuFirmware=0" ]; + # }; - environment.systemPackages = with pkgs; [ - egl-wayland - ]; + # environment.systemPackages = with pkgs; [ + # egl-wayland + # ]; hardware = { nvidia = { - # Modesetting is required. - modesetting.enable = lib.mkDefault true; - - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead - # of just the bare essentials. - powerManagement.enable = lib.mkDefault false; - - # Fine-grained power management. Turns off GPU when not in use. - # Experimental and only works on modern Nvidia GPUs (Turing or newer). - powerManagement.finegrained = lib.mkDefault false; + powerManagement = { + enable = lib.mkDefault false; + finegrained = lib.mkDefault false; + }; - # Use the NVidia open source kernel module (not to be confused with the - # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus - # Only available from driver 515.43.04+ - # Currently alpha-quality/buggy, so false is currently the recommended setting. - open = lib.mkDefault false; - - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. nvidiaSettings = lib.mkDefault false; # package = lib.mkDefault config.boot.kernelPackages.nvidiaPackages.beta; # package = lib.mkDefault config.boot.kernelPackages.nvidiaPackages.production; - # package = lib.mkDefault config.boot.kernelPackages.nvidiaPackages.stable; + package = lib.mkDefault config.boot.kernelPackages.nvidiaPackages.stable; # package = lib.mkDefault config.boot.kernelPackages.nvidiaPackages.mkDriver { # version = "555.58.02"; # sha256_64bit = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM="; @@ -59,20 +39,19 @@ # settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8="; # persistencedSha256 = "sha256-a1D7ZZmcKFWfPjjH1REqPM5j/YLWKnbkP9qfRyIyxAw="; # }; - package = lib.mkDefault ( - config.boot.kernelPackages.nvidiaPackages.mkDriver { - version = "560.35.03"; - sha256_64bit = "sha256-8pMskvrdQ8WyNBvkU/xPc/CtcYXCa7ekP73oGuKfH+M="; - sha256_aarch64 = "sha256-s8ZAVKvRNXpjxRYqM3E5oss5FdqW+tv1qQC2pDjfG+s="; - openSha256 = "sha256-/32Zf0dKrofTmPZ3Ratw4vDM7B+OgpC4p7s+RHUjCrg="; - settingsSha256 = "sha256-kQsvDgnxis9ANFmwIwB7HX5MkIAcpEEAHc8IBOLdXvk="; - persistencedSha256 = "sha256-E2J2wYYyRu7Kc3MMZz/8ZIemcZg68rkzvqEwFAL3fFs="; - } - ); - }; - graphics = { - enable = lib.mkDefault true; + # package = lib.mkDefault ( + # config.boot.kernelPackages.nvidiaPackages.mkDriver { + # version = "560.35.03"; + # sha256_64bit = "sha256-8pMskvrdQ8WyNBvkU/xPc/CtcYXCa7ekP73oGuKfH+M="; + # sha256_aarch64 = "sha256-s8ZAVKvRNXpjxRYqM3E5oss5FdqW+tv1qQC2pDjfG+s="; + # openSha256 = "sha256-/32Zf0dKrofTmPZ3Ratw4vDM7B+OgpC4p7s+RHUjCrg="; + # settingsSha256 = "sha256-kQsvDgnxis9ANFmwIwB7HX5MkIAcpEEAHc8IBOLdXvk="; + # persistencedSha256 = "sha256-E2J2wYYyRu7Kc3MMZz/8ZIemcZg68rkzvqEwFAL3fFs="; + # } + # ); }; + + graphics.enable = lib.mkDefault true; }; }; }