feat(nixosmodules): add steam module
This commit is contained in:
parent
45f314f71b
commit
b62ca97ccb
3 changed files with 45 additions and 0 deletions
42
modules/nixos/gaming.nix
Normal file
42
modules/nixos/gaming.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
moduleName = "gaming";
|
||||
cfg = config."${moduleName}";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
"${moduleName}" = {
|
||||
steam = {
|
||||
enable = lib.mkEnableOption "Enable Steam.";
|
||||
enableGamescope = lib.mkEnableOption "Enable the gamescope compositor.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.steam.enable {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
protontricks.enable = true;
|
||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
steam-run
|
||||
];
|
||||
})
|
||||
(lib.mkIf cfg.steam.enableGamescope {
|
||||
programs.steam.gamescopeSession.enable = true;
|
||||
programs.gamescope = {
|
||||
enable = true;
|
||||
capSysNice = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue