about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--dotfiles/.xinitrc6
-rw-r--r--hosts/phobos/hardware.nix22
2 files changed, 18 insertions, 10 deletions
diff --git a/dotfiles/.xinitrc b/dotfiles/.xinitrc
index 5ef0d67..86af4aa 100644
--- a/dotfiles/.xinitrc
+++ b/dotfiles/.xinitrc
@@ -36,6 +36,12 @@ if command -v dbus-update-activation-environment >/dev/null 2>&1; then
         dbus-update-activation-environment DISPLAY XAUTHORITY
 fi
 
+# NEEDED FOR NVIDIA DRIVERS
+if [ -x "$(command -v nvidia-smi)" ]; then
+  xrandr --setprovideroutputsource modesetting NVIDIA-0
+fi
+
+xrandr --auto
 #xrandr -s 1920x1080 &
 
 sxhkd &
diff --git a/hosts/phobos/hardware.nix b/hosts/phobos/hardware.nix
index 84e9b8b..d13c0a1 100644
--- a/hosts/phobos/hardware.nix
+++ b/hosts/phobos/hardware.nix
@@ -25,9 +25,9 @@ in
 
   powerManagement.cpuFreqGovernor = powerMode;
 
-  #services.xserver.videoDrivers = [ "nvidia" ];
   services.xserver = {
-    videoDrivers = [ "intel" ];
+    videoDrivers = [ "nvidia" ];
+
     # Enable touchpad support (enabled default in most desktopManager).
     libinput.enable = true;
   };
@@ -38,16 +38,18 @@ in
       driSupport = true;
     };
 
-    # nvidia.modesetting.enable = true;
-    /*nvidia.prime = {
-      sync.enable = true;
+    nvidia = {
+      modesetting.enable = true;
+      prime = {
+        sync.enable = true;
 
-      # Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
-      nvidiaBusId = "PCI:1:0:0";
+        # Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
+        nvidiaBusId = "PCI:1:0:0";
 
-      # Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
-      intelBusId = "PCI:0:2:0";
-      };*/
+        # Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
+        intelBusId = "PCI:0:2:0";
+      };
+    };
   };
 
 }