refactor: removing needless module complexity

This commit is contained in:
cnst
2024-10-27 09:14:34 +01:00
parent d8f810ee05
commit 4887feccfd
175 changed files with 920 additions and 1118 deletions

View File

@@ -0,0 +1,64 @@
# Yanked from Misterio77
{
pkgs,
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption concatStringsSep head filter getExe;
cfg = config.home.programs.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.programs.steam.enable = mkEnableOption "Enables steam";
};
config = {
home.packages = mkIf cfg.enable [
steam-with-pkgs
steam-session
pkgs.gamescope
];
};
}