Open samueldr opened 2 years ago
Giving this a shot.
It's been a hot minute.. but finally got around to working on this again and nearly had it finished, and then subsequently realized that the custom gamescope-session was removed.
I have hand mapped each arg shown in gamescope --help
to an equivalent module option. For defaults, I've used either the value defined in gamescope_incantation or the current gamescope default - in that order of precedence.
Since we don't need this any more, I'm just going to leave this comparison of the branches here, and possibly close this ticket. https://github.com/Jovian-Experiments/Jovian-NixOS/compare/development...m1cr0man:Jovian-NixOS:081eb3354d2ffdefa8c98bed352dc8727cd0c328?expand=1
I clicked on your link and thinking it was merged just tried the following... then realized it was from your repo, dough!
You say we don't need this anymore, but I couldn't figure out the correct way to reorder the prefered outputs looking at the Jovian docs
jovian.steam = {
enable = true;
autoStart = true;
desktopSession = "plasma";
gamescopeOptions = {
preferOutput = [ "DP-*" "HDMI-*" "*" "eDP-1" ];
};
};
My statement on not needing this was related to the fact that the custom gamescope-session was removed and so all the custom options wouldn't actually have any effect anymore.
Nowadays, you would have to add a patch to pkgs.gamescope-session and modify the preferOutput line. Fortunately, I imagine that line is pretty stable and a patch should survive multiple updates. Unfortunately, it is a bit more awkward than if there was options implemented.
Come to think of it, perhaps there is a path forward...
We could add a patch converting most of the gamescope invokation arguments to an environment variable, and use a systemd override defined in the Nix config for a system to specify the gamescopeOptions
to use through said env var. It means we don't need a custom copy of the entirety of gamescope-session, and provide the flexibility that the option set grants. The option defaults would have to match the vendor defaults, resulting in the same args. Example POC:
{ config, ... }: {
systemd.services.gamescope-session = {
overrideStrategy = "asDropin";
environment.GAMESCOPE_ARGS = config.jovian.steam.gamescopeOptions.finalArguments;
};
}
.. and would also need the relevant gamescope-session patch. Happy to do a PR if there's interest, but I don't actually run NixOS on my own deck anymore so I can't test it :sweat_smile:
Add options for gamescope+steam
Relevant options:
_Originally posted by @samueldr in https://github.com/Jovian-Experiments/Jovian-NixOS/pull/3#discussion_r851590072_