From 351dba4281648295314e1f297ca9a42c41bd0282 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Sat, 16 Mar 2024 17:56:41 +0100 Subject: [PATCH] add ogl --- default.nix | 1 + modules/opengl.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 modules/opengl.nix diff --git a/default.nix b/default.nix index 1b1a46a..461b15b 100644 --- a/default.nix +++ b/default.nix @@ -66,5 +66,6 @@ in { ./modules/networking.nix ./modules/toolchains.nix ./modules/sound.nix + ./modules/opengl.nix ]; } diff --git a/modules/opengl.nix b/modules/opengl.nix new file mode 100644 index 0000000..dc41b89 --- /dev/null +++ b/modules/opengl.nix @@ -0,0 +1,29 @@ +{ pkgs, config, lib, ... }: let + cfg = config.grimmShared; +in { + config = with cfg; lib.mkIf (enable && graphical) { + # Enable OpenGL + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + extraPackages = with pkgs; []; + }; + + boot.kernelParams = [ "nouveau.config=NvGspRm=1" ]; + + environment.sessionVariables = { + __GL_LOG_MAX_ANISO = "0"; + __GL_SHADER_DISK_CACHE = "1"; + __GL_SYNC_TO_VBLANK = "0"; + __GL_THREADED_OPTIMIZATIONS = "1"; + __GL_VRR_ALLOWED = "1"; +# MESA_LOADER_DRIVER_OVERRIDE="zink"; +# FLATPAK_GL_DRIVERS="mesa-git"; + }; + + environment.systemPackages = with pkgs; [ + glfw + ]; + }; +}