From 2384fc9224dc0c103a92d7f8ce24f1611e510ce0 Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Sat, 22 Jun 2024 17:50:00 +0100 Subject: [PATCH] Use nvidia 470 legacy driver on hypnos --- flake.nix | 1 + hosts/hypnos/default.nix | 9 +++++++++ hosts/hypnos/hardware-configuration.nix | 10 +++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index a8a9290..c880b1d 100644 --- a/flake.nix +++ b/flake.nix @@ -77,6 +77,7 @@ nixpkgs.pkgs = import nixpkgs { inherit overlays system; config.allowUnfree = true; + config.nvidia.acceptLicense = true; }; networking.hostName = name; }) diff --git a/hosts/hypnos/default.nix b/hosts/hypnos/default.nix index d67ca5e..fe70bcb 100644 --- a/hosts/hypnos/default.nix +++ b/hosts/hypnos/default.nix @@ -14,6 +14,15 @@ networking.hostId = "cf791898"; + # nvidia 470 driver doesn't work with Wayland + services.xserver = { + displayManager.gdm.wayland = lib.mkForce false; + videoDrivers = [ "nvidia" ]; + }; + + # Workaround for label rendering bug in GTK4 with nvidia 470 driver + environment.sessionVariables.GSK_RENDERER = "gl"; + modules = { desktop = { browsers = { diff --git a/hosts/hypnos/hardware-configuration.nix b/hosts/hypnos/hardware-configuration.nix index fbc0f12..88dd874 100644 --- a/hosts/hypnos/hardware-configuration.nix +++ b/hosts/hypnos/hardware-configuration.nix @@ -8,7 +8,10 @@ boot = { initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; kernelModules = [ "applesmc" "kvm-intel" "wl" ]; - extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; + extraModulePackages = [ + config.boot.kernelPackages.broadcom_sta + config.boot.kernelPackages.nvidiaPackages.legacy_470 + ]; }; networking.useDHCP = lib.mkDefault true; @@ -17,6 +20,11 @@ hardware = { cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.legacy_470; + modesetting.enable = true; + powerManagement.enable = true; + }; opengl = { enable = true; extraPackages = with pkgs; [