From 33a01619cfee49e99f5a006f2fd53695a82b9c3a Mon Sep 17 00:00:00 2001 From: randomuser Date: Thu, 3 Aug 2023 14:32:53 -0500 Subject: [PATCH] add the nvidia and steam configurations for mlg --- boxes/mlg.nix | 2 +- common/nvidia.nix | 14 ++++++++++++++ common/steam.nix | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 common/steam.nix diff --git a/boxes/mlg.nix b/boxes/mlg.nix index 5c9146e..f609513 100644 --- a/boxes/mlg.nix +++ b/boxes/mlg.nix @@ -5,7 +5,7 @@ ../common/desktop.nix ../common/steam.nix ../common/minecraft.nix -# ../common/nvidia.nix + ../common/nvidia.nix ]; boot.loader = { diff --git a/common/nvidia.nix b/common/nvidia.nix index 31338da..21e57c9 100644 --- a/common/nvidia.nix +++ b/common/nvidia.nix @@ -7,6 +7,10 @@ driSupport32Bit = true; }; + environment.systemPackages = with pkgs; [ + glxinfo + ]; + # Tell Xorg to use the nvidia driver (also valid for Wayland) services.xserver.videoDrivers = ["nvidia"]; @@ -24,5 +28,15 @@ # Optionally, you may need to select the appropriate driver version for your specific GPU. package = config.boot.kernelPackages.nvidiaPackages.stable; + + prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; }; } diff --git a/common/steam.nix b/common/steam.nix new file mode 100644 index 0000000..27e12ba --- /dev/null +++ b/common/steam.nix @@ -0,0 +1,13 @@ +{ lib, config, pkgs, ... }: + +{ + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + + environment.systemPackages = with pkgs; [ + steam-run + ]; +}