From e318801d7965d498021cb5fef81367c5fe805ff3 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Sat, 20 Jul 2024 18:15:02 +0300 Subject: [PATCH] feat(roles/gaming): move steam, add lutris --- hosts/alice/default.nix | 6 ++++- roles/default.nix | 3 ++- roles/gaming/default.nix | 58 ++++++++++++++++++++++++++++++++++++++++ roles/gaming/lutris.nix | 16 +++++++++++ roles/gaming/steam.nix | 22 +++++++++++++++ 5 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 roles/gaming/default.nix create mode 100644 roles/gaming/lutris.nix create mode 100644 roles/gaming/steam.nix diff --git a/hosts/alice/default.nix b/hosts/alice/default.nix index 1270723..0f6d798 100644 --- a/hosts/alice/default.nix +++ b/hosts/alice/default.nix @@ -36,5 +36,9 @@ roles.nvidia.enable = true; roles.plasma.enable = true; - roles.steam.enable = true; + roles.gaming = { + enable = true; + lutris.enable = true; + steam.enable = true; + }; } diff --git a/roles/default.nix b/roles/default.nix index 225d68e..a3c1a5d 100644 --- a/roles/default.nix +++ b/roles/default.nix @@ -1,6 +1,8 @@ {...}: { imports = [ + ./gaming ./shell + ./audio.nix ./bluetooth.nix ./base.nix @@ -11,7 +13,6 @@ ./nvidia.nix ./plasma.nix ./qutebrowser.nix - ./steam.nix ./zellij.nix ]; } diff --git a/roles/gaming/default.nix b/roles/gaming/default.nix new file mode 100644 index 0000000..3c2be4f --- /dev/null +++ b/roles/gaming/default.nix @@ -0,0 +1,58 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.roles.gaming; +in { + imports = [ + ./lutris.nix + ./steam.nix + ]; + + options.roles.gaming = { + enable = lib.mkEnableOption "gaming utilities"; + lutris.enable = lib.mkEnableOption "Lutris"; + steam.enable = lib.mkEnableOption "Steam"; + }; + + config = lib.mkIf cfg.enable { + programs.gamemode = { + enable = true; + }; + + environment.systemPackages = with pkgs; [ + gamescope + protontricks + gnome.zenity + ]; + + hm = { + programs.mangohud = { + enable = true; + enableSessionWide = false; + settings = { + fps_limit = "60,90,120,200"; + time = true; + + gpu_stats = true; + gpu_temp = true; + gpu_text = "GPU"; + + cpu_stats = true; + cpu_temp = true; + cpu_text = "CPU"; + + vram = true; + ram = true; + + fps = true; + frametime = true; + frame_timing = true; + show_fps_limit = true; + }; + }; + }; + }; +} diff --git a/roles/gaming/lutris.nix b/roles/gaming/lutris.nix new file mode 100644 index 0000000..7fa9e41 --- /dev/null +++ b/roles/gaming/lutris.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.roles.gaming; +in { + config = lib.mkIf cfg.lutris.enable { + environment.systemPackages = with pkgs; [ + lutris + + wineWowPackages.stable + ]; + }; +} diff --git a/roles/gaming/steam.nix b/roles/gaming/steam.nix new file mode 100644 index 0000000..60eca89 --- /dev/null +++ b/roles/gaming/steam.nix @@ -0,0 +1,22 @@ +{ + config, + lib, + ... +}: let + cfg = config.roles.gaming; +in { + config = lib.mkIf cfg.steam.enable { + arta.unfree.allow = [ + "steam-run" + "steam-original" + "steam" + ]; + + programs.steam = { + enable = true; + remotePlay.openFirewall = false; + dedicatedServer.openFirewall = false; + }; + hardware.steam-hardware.enable = true; + }; +} -- 2.44.1