nix-config/modules/games/default.nix
2024-08-05 20:05:06 +02:00

39 lines
954 B
Nix

{ lib, config, pkgs, ... }: let
inherit (lib) mkIf mkMerge;
inherit (config) conf;
holo-script = pkgs.writeShellApplication {
name = "holo-script";
runtimeInputs = [ pkgs.steam pkgs.gamescope ];
text = ''
gamescope -f -h 1504 -w 2256 -r 60 -F fsr -e -- steam
'';
};
holo = pkgs.makeDesktopItem {
name = "holo";
desktopName = "Holo";
exec = "${holo-script}/bin/holo-script";
};
in mkIf conf.games.enable (mkMerge [
(mkIf conf.impermanence.enable {
environment.persistence."/persist".users.${conf.username}= {
directories = [
"Games"
".steam"
".local/share/PrismLauncher"
];
};
}) {
programs.steam.enable = true;
programs.gamescope.enable = true;
programs.gamemode.enable = true;
home-manager.users.${conf.username} = {
home.packages = [
pkgs.prismlauncher
pkgs.heroic
pkgs.itch
holo
];
};
}
])