add nvidia support options

Change-Id: I3df2e524fbd3a096ef0c4464af2b0ed4f138cbe3
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/642
Tested-by: Samuel Shuert <coded@clicks.codes>
Reviewed-by: Samuel Shuert <coded@clicks.codes>
diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix
index f313651..4aa178d 100644
--- a/modules/home/hyprland/default.nix
+++ b/modules/home/hyprland/default.nix
@@ -31,9 +31,11 @@
         default = null;
       };
     };
+
+    nvidia.enable = lib.mkEnableOption "Enable NVIDIA support";
+
     hyprland = {
       enable = lib.mkEnableOption "Use hyprland as your window manager";
-
       monitors = lib.mkOption {
         type = lib.types.listOf lib.types.str;
         description = "List of default monitors to set";
@@ -176,6 +178,14 @@
             "${mod}, mouse:272, movewindow"
             "${mod}, mouse:273, resizewindow"
           ];
+
+          env = lib.mkIf config.chimera.nvidia.enable [
+            "LIBVA_DRIVER_NAME,nvidia"
+            "XDG_SESSION_TYPE,wayland"
+            "GBM_BACKEND,nvidia-drm"
+            "__GLX_VENDOR_LIBRARY_NAME,nvidia"
+            "WLR_NO_HARDWARE_CURSORS,1"
+          ]
         };
     };
   };
diff --git a/modules/nixos/video/nvidia/default.nix b/modules/nixos/video/nvidia/default.nix
new file mode 100644
index 0000000..b2b0de4
--- /dev/null
+++ b/modules/nixos/video/nvidia/default.nix
@@ -0,0 +1,14 @@
+{ lib, config, ... }:
+{
+  options.chimera.nvidia.enable = lib.mkEnableOption "Enable NVIDIA hardware support";
+
+  config = {
+    services.xserver.videoDrivers = lib.mkIf config.chimera.nvidia.enable ["nvidia"];
+    hardware.nvidia = lib.mkIf config.chimera.nvidia.enable {
+      modesetting.enable = true;
+      open = false;
+      nvidiaSettings = true;
+      package = config.boot.kernelPackages.nvidiaPackages.stable;
+    };
+  };
+}
diff --git a/systems/x86_64-linux/saurosuchus/default.nix b/systems/x86_64-linux/saurosuchus/default.nix
index a0106ab..e9e240a 100644
--- a/systems/x86_64-linux/saurosuchus/default.nix
+++ b/systems/x86_64-linux/saurosuchus/default.nix
@@ -6,6 +6,7 @@
     ./hardware/boot
     ./hardware/cpu
     ./hardware/filesystems
+    ./hardware/video
     ./networking
     ./openrgb
     ./users