From f29a7c500704f5df0716084750d3ed0f9dec5176 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Tue, 16 Jul 2024 19:30:16 +0300 Subject: [PATCH] feat(roles/steam, hosts/arwen): steam role and enable for arwen --- hosts/arwen/default.nix | 2 ++ roles/default.nix | 1 + roles/steam.nix | 64 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 roles/steam.nix diff --git a/hosts/arwen/default.nix b/hosts/arwen/default.nix index fc8a7e6..97ad365 100644 --- a/hosts/arwen/default.nix +++ b/hosts/arwen/default.nix @@ -37,4 +37,6 @@ roles.zellij.enable = true; roles.kitty.enable = true; roles.hyprland.enable = true; + + roles.steam.enable = true; } diff --git a/roles/default.nix b/roles/default.nix index fc1fe63..60f1478 100644 --- a/roles/default.nix +++ b/roles/default.nix @@ -8,6 +8,7 @@ ./kitty.nix ./nix.nix ./shell.nix + ./steam.nix ./zellij.nix ]; } diff --git a/roles/steam.nix b/roles/steam.nix new file mode 100644 index 0000000..d0373ed --- /dev/null +++ b/roles/steam.nix @@ -0,0 +1,64 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.roles.steam; +in { + options.roles.steam = { + enable = lib.mkEnableOption ""; + }; + + config = lib.mkIf cfg.enable { + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "steam-run" + "steam-original" + "steam" + ]; + + programs.steam = { + enable = true; + remotePlay.openFirewall = false; + dedicatedServer.openFirewall = false; + }; + hardware.steam-hardware.enable = true; + 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; + }; + }; + }; + }; +} -- 2.44.1