65 lines
1.4 KiB
Nix
65 lines
1.4 KiB
Nix
# Yanked from Misterio77
|
|
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
inherit (lib) mkIf mkEnableOption concatStringsSep head filter getExe;
|
|
cfg = config.home.gaming.steam;
|
|
steam-with-pkgs = pkgs.steam.override {
|
|
extraPkgs = pkgs:
|
|
with pkgs; [
|
|
xorg.libXcursor
|
|
xorg.libXi
|
|
xorg.libXinerama
|
|
xorg.libXScrnSaver
|
|
libpng
|
|
libpulseaudio
|
|
libvorbis
|
|
stdenv.cc.cc.lib
|
|
libkrb5
|
|
keyutils
|
|
gamescope
|
|
];
|
|
};
|
|
|
|
monitor = head (filter (m: m.primary) config.monitors);
|
|
steam-session = let
|
|
gamescope = concatStringsSep " " [
|
|
(getExe pkgs.gamescope)
|
|
"--output-width ${toString monitor.width}"
|
|
"--output-height ${toString monitor.height}"
|
|
"--framerate-limit ${toString monitor.refreshRate}"
|
|
"--prefer-output ${monitor.name}"
|
|
# "--adaptive-sync"
|
|
"--expose-wayland"
|
|
"--hdr-enabled"
|
|
"--steam"
|
|
];
|
|
steam = concatStringsSep " " [
|
|
"steam"
|
|
"steam://open/bigpicture"
|
|
];
|
|
in
|
|
pkgs.writeTextDir "share/wayland-sessions/steam-sesson.desktop" # ini
|
|
|
|
''
|
|
[Desktop Entry]
|
|
Name=Steam Session
|
|
Exec=${gamescope} -- ${steam}
|
|
Type=Application
|
|
'';
|
|
in {
|
|
options = {
|
|
home.gaming.steam.enable = mkEnableOption "Enables steam";
|
|
};
|
|
config = {
|
|
home.packages = mkIf cfg.enable [
|
|
steam-with-pkgs
|
|
steam-session
|
|
pkgs.gamescope
|
|
];
|
|
};
|
|
}
|