feat(steam): configure SteamVR support
This commit is contained in:
@@ -46,7 +46,10 @@
|
|||||||
modules.desktop.apps.r2modman.enable = true;
|
modules.desktop.apps.r2modman.enable = true;
|
||||||
modules.desktop.emulation.enable = true;
|
modules.desktop.emulation.enable = true;
|
||||||
modules.desktop.apps.signal.enable = true;
|
modules.desktop.apps.signal.enable = true;
|
||||||
modules.desktop.apps.steam.enable = true;
|
modules.desktop.apps.steam = {
|
||||||
|
enable = true;
|
||||||
|
vr.enable = true;
|
||||||
|
};
|
||||||
modules.desktop.apps.vencord.enable = true;
|
modules.desktop.apps.vencord.enable = true;
|
||||||
|
|
||||||
home-manager.users.${config.user.name}.wayland.windowManager.hyprland.settings.monitor = [
|
home-manager.users.${config.user.name}.wayland.windowManager.hyprland.settings.monitor = [
|
||||||
|
|||||||
@@ -6,28 +6,62 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# Steam game launcher and runtime integration.
|
# Steam game launcher and runtime integration.
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.steam;
|
||||||
|
steamVrLauncher = "/home/${config.user.name}/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.modules.desktop.apps.steam.enable = lib.mkEnableOption "Steam game launcher";
|
options.modules.desktop.apps.steam = {
|
||||||
|
enable = lib.mkEnableOption "Steam game launcher";
|
||||||
|
|
||||||
config = lib.mkIf config.modules.desktop.apps.steam.enable {
|
vr.enable = lib.mkEnableOption "SteamVR with VRLink";
|
||||||
programs.gamemode.enable = true;
|
|
||||||
|
|
||||||
programs.steam = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.steam.override {
|
|
||||||
extraEnv.STEAM_FORCE_DESKTOPUI_SCALING = "1.5";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.steam-hardware.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.gamescope
|
|
||||||
];
|
|
||||||
|
|
||||||
registry.window-icon.${config.networking.hostName}.steam = {
|
|
||||||
class = "[Ss]team";
|
|
||||||
icon = util.glyph "f1b6";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
programs.gamemode.enable = true;
|
||||||
|
|
||||||
|
programs.steam = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.steam.override {
|
||||||
|
extraEnv.STEAM_FORCE_DESKTOPUI_SCALING = "1.5";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.steam-hardware.enable = true;
|
||||||
|
|
||||||
|
programs.gamescope.enable = true;
|
||||||
|
|
||||||
|
registry.window-icon.${config.networking.hostName}.steam = {
|
||||||
|
class = "[Ss]team";
|
||||||
|
icon = util.glyph "f1b6";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
(lib.mkIf cfg.vr.enable {
|
||||||
|
networking.firewall.allowedUDPPorts = [ 10400 ];
|
||||||
|
|
||||||
|
programs.gamescope.capSysNice = true;
|
||||||
|
|
||||||
|
systemd.paths.steamvr-capabilities = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
pathConfig = {
|
||||||
|
PathChanged = steamVrLauncher;
|
||||||
|
Unit = "steamvr-capabilities.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.steamvr-capabilities = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
path = [ pkgs.libcap ];
|
||||||
|
script = ''
|
||||||
|
if [ -e ${lib.escapeShellArg steamVrLauncher} ]; then
|
||||||
|
setcap cap_sys_nice=eip ${lib.escapeShellArg steamVrLauncher}
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user