From e1d352d0193c180d1077e1ad6faea5927d85c3a8 Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 29 Jun 2023 17:35:20 +0200 Subject: [PATCH 1/6] Add gaming role --- roles/gaming/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 roles/gaming/default.nix diff --git a/roles/gaming/default.nix b/roles/gaming/default.nix new file mode 100755 index 0000000..f3991a4 --- /dev/null +++ b/roles/gaming/default.nix @@ -0,0 +1,6 @@ +{ ... }: + +{ + imports = [ + ]; +} From 757f60070fc96bfebb18d0ec7af45c7b40d633e1 Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 29 Jun 2023 18:42:24 +0200 Subject: [PATCH 2/6] Gaming: enable steam --- roles/gaming/default.nix | 1 + roles/gaming/steam.nix | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 roles/gaming/steam.nix diff --git a/roles/gaming/default.nix b/roles/gaming/default.nix index f3991a4..3a963cc 100755 --- a/roles/gaming/default.nix +++ b/roles/gaming/default.nix @@ -2,5 +2,6 @@ { imports = [ + ./steam.nix ]; } diff --git a/roles/gaming/steam.nix b/roles/gaming/steam.nix new file mode 100644 index 0000000..178dc44 --- /dev/null +++ b/roles/gaming/steam.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + programs.steam = { + enable = true; + # Doubt that I'll use it, but I'll enable it anyways + remotePlay.openFirewall = true; + }; +} From 4ba470cf5d3e9f4178fd53b7d4af35259e2e2c6c Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 29 Jun 2023 18:42:41 +0200 Subject: [PATCH 3/6] Archie: add gaming role --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 5b5c277..6c02a6b 100755 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,7 @@ outputs = {nixpkgs, nixpkgs-unstable, agenix, home-manager, home-manager-unstabl ./roles/common ./roles/desktop ./roles/kde + ./roles/gaming ./machines/Archie ]; }; From 2d69565d91c39c8242c4c24a5e400da54056de0a Mon Sep 17 00:00:00 2001 From: Toast Date: Fri, 30 Jun 2023 12:10:07 +0200 Subject: [PATCH 4/6] Firefox: disable widget.use-xdg-desktop-portal.mime-handler --- roles/desktop/firefox.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/desktop/firefox.nix b/roles/desktop/firefox.nix index 5a44b3f..643f174 100644 --- a/roles/desktop/firefox.nix +++ b/roles/desktop/firefox.nix @@ -41,12 +41,12 @@ "Status" = "default"; }; /* - Not sure what this does, - but https://wiki.archlinux.org/title/Firefox#KDE_integration - tells me to enable it + https://wiki.archlinux.org/title/Firefox#KDE_integration tells me to enable this, + but strangely enough doing so makes firefox ask to be set as the default browser + every time you start it up, so I'll disable it */ "widget.use-xdg-desktop-portal.mime-handler" = { - "Value" = 1; + "Value" = 0; "Status" = "default"; }; }; From 8f7e8e3661a991e7bf044bac5c5a5670b293b555 Mon Sep 17 00:00:00 2001 From: Toast Date: Fri, 30 Jun 2023 12:15:13 +0200 Subject: [PATCH 5/6] Steam: enable pipewire alsa compatibility --- roles/gaming/steam.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/gaming/steam.nix b/roles/gaming/steam.nix index 178dc44..1c71901 100644 --- a/roles/gaming/steam.nix +++ b/roles/gaming/steam.nix @@ -6,4 +6,6 @@ # Doubt that I'll use it, but I'll enable it anyways remotePlay.openFirewall = true; }; + # Some linux native games (rise of the tomb raider) use alsa for sound + services.pipewire.alsa.enable = true; } From e844d29eaec24bb12f799bcabb458bb658813273 Mon Sep 17 00:00:00 2001 From: Toast Date: Fri, 30 Jun 2023 16:43:30 +0200 Subject: [PATCH 6/6] Gaming: enable mangohud --- roles/gaming/default.nix | 1 + roles/gaming/mangohud.nix | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 roles/gaming/mangohud.nix diff --git a/roles/gaming/default.nix b/roles/gaming/default.nix index 3a963cc..fb3cce4 100755 --- a/roles/gaming/default.nix +++ b/roles/gaming/default.nix @@ -3,5 +3,6 @@ { imports = [ ./steam.nix + ./mangohud.nix ]; } diff --git a/roles/gaming/mangohud.nix b/roles/gaming/mangohud.nix new file mode 100644 index 0000000..ff6f5df --- /dev/null +++ b/roles/gaming/mangohud.nix @@ -0,0 +1,19 @@ +{ config, ... }: + +{ + # This does the same as enableSessionWide does on the mangohud config + environment.sessionVariables = { MANGOHUD = "1"; MANGOHUD_DLSYM = "1"; }; + + home-manager.users.toast = { config, ... }: + { + programs.mangohud = { + enable = true; + # TODO: fix envvars set by home manager not applying for some reason + # This only works for Vulkan, openGL programs still need the mangohud wrapper + enableSessionWide = true; + settings = { + preset = 4; + }; + }; + }; +}