From 6f2d91716d71cb68c820efa934675c9409f88b71 Mon Sep 17 00:00:00 2001 From: Krzysztof Saczuk Date: Sun, 12 May 2024 05:45:55 +0200 Subject: [PATCH] feat: add steam --- modules/desktop/apps/steam.nix | 27 +++++++++++++++++++++++++++ modules/desktop/wm/hyprland.nix | 1 + modules/hardware/amdgpu.nix | 13 ++++++++++--- modules/hardware/layout.nix | 5 ++++- 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 modules/desktop/apps/steam.nix diff --git a/modules/desktop/apps/steam.nix b/modules/desktop/apps/steam.nix new file mode 100644 index 0000000..22b268c --- /dev/null +++ b/modules/desktop/apps/steam.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; +with lib.my; { + environment = { + sessionVariables = { + STEAM_EXTRA_COMPAT_TOOLS_PATHS = makeSearchPathOutput "steamcompattool" "" config.programs.steam.extraCompatPackages; + }; + systemPackages = with pkgs; [mangohud steam-run]; + }; + + programs = { + gamescope.enable = true; + gamemode.enable = true; + steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + gamescopeSession.enable = true; + extraCompatPackages = with pkgs; [proton-ge-nostale proton-ge-bin]; + }; + }; +} diff --git a/modules/desktop/wm/hyprland.nix b/modules/desktop/wm/hyprland.nix index bc0a635..079368e 100644 --- a/modules/desktop/wm/hyprland.nix +++ b/modules/desktop/wm/hyprland.nix @@ -24,6 +24,7 @@ in "gtk" "qt" "grimblast" + "steam" ]; extraConfig = { diff --git a/modules/hardware/amdgpu.nix b/modules/hardware/amdgpu.nix index 37b1e71..7860f71 100644 --- a/modules/hardware/amdgpu.nix +++ b/modules/hardware/amdgpu.nix @@ -12,9 +12,16 @@ in { }; config = mkIf (cfg.enable) { - services.xserver.videoDrivers = mkIf config.services.xserver.enable ["amdgpu"]; - - hardware.enableRedistributableFirmware = true; + services.xserver.videoDrivers = ["amdgpu"]; boot.initrd.kernelModules = ["amdgpu"]; + + hardware = { + enableRedistributableFirmware = true; + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + }; }; } diff --git a/modules/hardware/layout.nix b/modules/hardware/layout.nix index 6001fee..7c7385f 100644 --- a/modules/hardware/layout.nix +++ b/modules/hardware/layout.nix @@ -238,7 +238,10 @@ in { }) cfg.layout; in { - deviceSection = concatLines (builtins.map (x: ''Option "monitor-${x.layout.monitor.xorg}" "${x.name}"'') heads); + deviceSection = concatLines ( + (builtins.map (x: ''Option "monitor-${x.layout.monitor.xorg}" "${x.name}"'') heads) + ++ [''Option "DRI" "3"''] + ); extraConfig = with lib; let mkMonitorSection = prev: curr: (singleton {