Use gamescope from git

This commit is contained in:
Nathan McCarty 2023-06-16 21:38:39 -04:00
parent 08884cf6e2
commit 89354f8032
Signed by: thatonelutenist
SSH Key Fingerprint: SHA256:hwQEcmak9E6sdU9bXc98RHw/Xd1AhpB5HZT7ZSVJkRM
3 changed files with 41 additions and 19 deletions

View File

@ -13,7 +13,6 @@ in with lib; {
})
# Prism Launcher minecraft stuff
glfw-patched
gamescope
];
unstable-packages =
with inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}"; [
@ -22,25 +21,32 @@ in with lib; {
prismlauncher
];
in stable-packages ++ unstable-packages;
# Setup gamescope
programs.gamescope = {
enable = true;
package = pkgs.gamescope.overrideAttrs (old: {
src = let
vals = builtins.fromJSON
(builtins.readFile ../../../sources/gamescope.json);
in pkgs.fetchFromGitHub {
owner = "ValveSoftware";
repo = "gamescope";
rev = vals.rev;
hash = vals.hash;
fetchSubmodules = true;
};
patches = [ ];
buildInputs = with pkgs;
old.buildInputs
++ [ glm xorg.xcbutilwm xorg.xcbutilerrors gbenchmark ];
});
};
# Install steam
programs.steam.enable = true;
# Make steam work with gamescope
nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
extraPkgs = pkgs:
with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
gtk3
];
programs.steam = {
enable = true;
gamescopeSession = {
enable = true;
args = [ "--rt" ];
};
};
};

4
sources/gamescope.json Normal file
View File

@ -0,0 +1,4 @@
{
"rev": "789cfc90575a7dbfc61ffa3325a4fb7f59f4d8b5",
"hash": "sha256-ThirEuHlxTTd2T8kuPTcDohMv7N7ZoSyWt0tzjpN6A0="
}

View File

@ -15,3 +15,15 @@ jq --null-input \
'{"version": $version, "url": $url, "hash": $hash}' \
> $DIRECTORY/swayimg.json
echo "swayimg now at $SWAYIMG_VERSION"
# Update gamescope
GAMESCOPE_BRANCH=$(curl https://api.github.com/repos/ValveSoftware/gamescope | jq -r '.default_branch')
GAMESCOPE_REV=$(curl https://api.github.com/repos/ValveSoftware/gamescope/git/refs/heads/$GAMESCOPE_BRANCH | \
jq -r '.object.sha')
GAMESCOPE_HASH=$(nix-prefetch fetchFromGitHub --owner ValveSoftware --repo gamescope --rev $GAMESCOPE_REV --fetchSubmodules)
jq --null-input \
--arg rev "$GAMESCOPE_REV" \
--arg hash "$GAMESCOPE_HASH" \
'{"rev": $rev, "hash": $hash}' \
> $DIRECTORY/gamescope.json
echo "gamescope now at $GAMESCOPE_REV"