forked from pub-solar/os
modules#steam: create xsession for Steam
This commit is contained in:
parent
e9be8e5f5e
commit
4ebf259d11
|
@ -3,4 +3,5 @@
|
|||
./security/mitigations.nix
|
||||
./services/hardware/wii-u-gc-adapter.nix
|
||||
./services/games/gamemode.nix
|
||||
./services/x11/window-managers/steam.nix
|
||||
]
|
||||
|
|
45
modules/services/x11/window-managers/steam.nix
Normal file
45
modules/services/x11/window-managers/steam.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.services.xserver.windowManager.steam;
|
||||
in {
|
||||
options = {
|
||||
services.xserver.windowManager.steam = {
|
||||
enable = mkEnableOption "steam";
|
||||
package = mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.steam;
|
||||
description = ''
|
||||
The Steam package to use.
|
||||
'';
|
||||
};
|
||||
extraSessionCommands = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
Shell commands executed just before Steam is started.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ cfg.package ];
|
||||
|
||||
services.xserver.windowManager.session = [{
|
||||
name = "steam";
|
||||
start = ''
|
||||
${cfg.extraSessionCommands}
|
||||
|
||||
# needed to ensure conflicting compositors are not running
|
||||
${pkgs.systemd}/bin/systemctl --user stop graphical-session.target
|
||||
|
||||
${pkgs.xorg.xset}/bin/xset -dpms
|
||||
${pkgs.xorg.xset}/bin/xset s off
|
||||
${pkgs.steamcompmgr}/bin/steamcompmgr &
|
||||
steam -tenfoot -fulldesktopres
|
||||
'';
|
||||
}];
|
||||
};
|
||||
}
|
34
pkgs/applications/window-managers/steamcompmgr/default.nix
Normal file
34
pkgs/applications/window-managers/steamcompmgr/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ stdenv, fetchFromGitHub, libudev, SDL, SDL_image, libXdamage, libXcomposite
|
||||
, libXrender, libXext, libXxf86vm, pkgconfig, autoreconfHook, gnumake }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "steamcompmgr";
|
||||
src = fetchFromGitHub {
|
||||
owner = "gamer-os";
|
||||
repo = "steamos-compositor-plus";
|
||||
rev = "c3855fcb5015ecdca299ee4b46b9f90c7a6788de";
|
||||
hash = "sha256-sRthjN+pnabl67PuJS+zbUznW4ws0fub0R9bTzelg18=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
libudev
|
||||
SDL
|
||||
SDL_image
|
||||
libXdamage
|
||||
libXcomposite
|
||||
libXrender
|
||||
libXext
|
||||
libXxf86vm
|
||||
pkgconfig
|
||||
autoreconfHook
|
||||
gnumake
|
||||
];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "SteamOS Compositor";
|
||||
homepage = "https://github.com/steamos-compositor-plus";
|
||||
maintainers = [ maintainers.nrdxp ];
|
||||
license = licenses.bsd2;
|
||||
inherit version;
|
||||
};
|
||||
}
|
|
@ -7,4 +7,6 @@ final: prev: {
|
|||
wii-u-gc-adapter = prev.callPackage ./misc/drivers/wii-u-gc-adapter { };
|
||||
libinih = prev.callPackage ./development/libraries/libinih { };
|
||||
gamemode = prev.callPackage ./os-specific/linux/gamemode { };
|
||||
steamcompmgr =
|
||||
prev.callPackage ./applications/window-managers/steamcompmgr { };
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
imports = [ ../graphical ./udev.nix ];
|
||||
environment.systemPackages = with unstablePkgs; [
|
||||
retroarchBare
|
||||
steam
|
||||
steam-run
|
||||
pcsx2
|
||||
qjoypad
|
||||
|
@ -15,6 +14,12 @@
|
|||
# fps games on laptop need this
|
||||
services.xserver.libinput.disableWhileTyping = false;
|
||||
|
||||
# Launch steam from display managers
|
||||
services.xserver.windowManager.steam = {
|
||||
enable = true;
|
||||
package = unstablePkgs.steam;
|
||||
};
|
||||
|
||||
# 32-bit support needed for steam
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
hardware.pulseaudio.support32Bit = true;
|
||||
|
|
Loading…
Reference in a new issue