Browse Source

Add gamescope optionally.

main
Philipp 3 months ago
parent
commit
80a52d6bf5
No known key found for this signature in database GPG Key ID: 2258EE3B85DE1748
  1. 7
      default.nix
  2. 50
      gamescope.nix

7
default.nix

@ -13,7 +13,9 @@
applyReccomendedWinePatches ? true,
virtualDesktop ? null,
registryFiles ? [ ],
captureMouse ? true
captureMouse ? true,
enableGameScope ? false,
gameScopeArgs ? [ "-W 2560" "-H 1440" "-b" ],
}:
#check wether string is two positive integers separated by x
@ -31,6 +33,7 @@ let
dxvk = (pkgsCross.mingwW64.callPackage ./dxvk.nix { async = dxvkAsync; }).overrideAttrs
( attrs: { patches = attrs.patches ++ dxvkPatches; });
dxvkAsyncEnv = "DXVK_ASYNC=1" ;
gamescope = "${pkgs.callPackage ./gamescope.nix {}}/bin/gamescope";
fonts = pkgs.callPackage ./fonts.nix {};
wine64 = "${winePkg}/bin/wine64";
@ -117,7 +120,7 @@ let
if [ ! -f "${installDir}/Roberts Space Industries/RSI Launcher/RSI Launcher.exe" ]; then
installLauncher
fi
${lib.optionalString enableGameScope "${gamescope} ${builtins.concatStringsSep " " gameScopeArgs} --\\" }
${wineMulti} \
${if virtualDesktop != null then "explorer /desktop=${binName},${virtualDesktop}" else ""} \
"$WINEPREFIX/drive_c/Program Files/Roberts Space Industries/RSI Launcher/RSI Launcher.exe" \

50
gamescope.nix

@ -0,0 +1,50 @@
{ stdenv, lib, pkgs, fetchFromGitHub, meson, ninja, wlroots, pkg-config, cmake, xorg, libdrm,
vulkan-loader, wayland, wayland-protocols, libxkbcommon, libcap, SDL2, glslang, libudev, pixman, libinput, }:
stdenv.mkDerivation rec {
pname = "gamescope";
version = "3.8.4";
src = fetchFromGitHub {
owner = "Plagman";
repo = pname;
rev = version;
sha256 = "1asgyxm05wqmcrvl9i50zx7yrg8ipw6pb5j0bzz31gn589rysgix";
fetchSubmodules = true;
};
nativeBuildInputs = [
meson
ninja
pkg-config
cmake
];
buildInputs = [
(pkgs.callPackage (pkgs.fetchurl {
name = "wlroots_13.nix";
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/c4976f356529978031f1ad2200015ad03de50cb9/pkgs/development/libraries/wlroots/default.nix";
sha256 = "49f053124e9029a6863582940af9fefc5e3012353a6b86a2e2214dc7cf6467da";
}) {})
libdrm
libxkbcommon
vulkan-loader
wayland
wayland-protocols
xorg.libX11
xorg.libXdamage
xorg.libXcomposite
xorg.libXrender
xorg.libXext
xorg.libXxf86vm
xorg.libXtst
xorg.libXres
xorg.libXi
libcap
SDL2
glslang
libudev
pixman
libinput
];
}
Loading…
Cancel
Save