diff --git a/hosts/sparky/default.nix b/hosts/sparky/default.nix index 697cbb4..bc5b60a 100644 --- a/hosts/sparky/default.nix +++ b/hosts/sparky/default.nix @@ -45,20 +45,43 @@ in enableIPv6 = false; }; + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + # Add additional package names here + "nvidia-x11" + "nvidia-settings" + "nvidia-persistenced" + ]; + services.displayManager.defaultSession = "cinnamon"; services.libinput.enable = true; services.xserver = { enable = true; - videoDrivers = [ "modesetting" ]; + videoDrivers = [ "nvidia" ]; displayManager.lightdm.enable = true; exportConfiguration = true; deviceSection = '' - Option "DRI" "2" - Option "TearFree" "true" ''; desktopManager = { cinnamon.enable = true; }; }; + + # Enable OpenGL + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + + # Load nvidia driver + hardware.nvidia = { + # https://nixos.wiki/wiki/Nvidia + modesetting.enable = true; + powerManagement.enable = false; + open = false; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; }