feat(nixosmodules): add steam module
This commit is contained in:
parent
45f314f71b
commit
b62ca97ccb
3 changed files with 45 additions and 0 deletions
|
@ -8,4 +8,6 @@
|
||||||
boot-config.bootloader = "systemd-boot";
|
boot-config.bootloader = "systemd-boot";
|
||||||
hardware-config.cpu = "amd";
|
hardware-config.cpu = "amd";
|
||||||
hardware-config.gpu = "nvidia";
|
hardware-config.gpu = "nvidia";
|
||||||
|
gaming.steam.enable = true;
|
||||||
|
gaming.steam.enableGamescope = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ in
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./nix-config.nix
|
./nix-config.nix
|
||||||
|
./gaming.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
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