From 5bd8332da0c3c4bfb005eb5f4a71819ee497b1c3 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Thu, 5 Sep 2024 16:20:22 +0200 Subject: [PATCH] put gaming configuration in module --- hosts/solaire/default.nix | 20 +------------------- modules/default.nix | 1 + modules/gaming.nix | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 19 deletions(-) create mode 100644 modules/gaming.nix diff --git a/hosts/solaire/default.nix b/hosts/solaire/default.nix index def7ac8..1cc0992 100644 --- a/hosts/solaire/default.nix +++ b/hosts/solaire/default.nix @@ -6,25 +6,7 @@ ]; modules.nvidia.enable = true; - - programs.steam = { - enable = true; - package = with pkgs; steam.override { extraPkgs = pkgs: [ attr ]; }; - gamescopeSession.enable = true; - }; - - programs.gamemode.enable = true; - - programs.coolercontrol = { - enable = true; - nvidiaSupport = true; - }; - - hardware.keyboard.qmk.enable = true; - environment.systemPackages = with pkgs; [ - via - ]; - services.udev.packages = [ pkgs.via ]; + modules.gaming.enable = true; stylix.image = ../../wallpapers/lucy-edgerunners-wallpaper.jpg; } diff --git a/modules/default.nix b/modules/default.nix index b63881c..87f3045 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,5 +3,6 @@ _: imports = [ ./nvidia.nix ./gnome.nix + ./gaming.nix ]; } diff --git a/modules/gaming.nix b/modules/gaming.nix new file mode 100644 index 0000000..2731b2b --- /dev/null +++ b/modules/gaming.nix @@ -0,0 +1,33 @@ +{ lib, config, pkgs, ... }: +let + cfg = config.modules.gaming; +in + { + options = { + modules.gaming = { + enable = lib.mkEnableOption "Enable the gaming module"; + }; + }; + + config = lib.mkIf cfg.enable { + programs.steam = { + enable = true; + package = with pkgs; steam.override { extraPkgs = pkgs: [ attr ]; }; + gamescopeSession.enable = true; + }; + + programs.gamemode.enable = true; + + programs.coolercontrol = { + enable = true; + nvidiaSupport = true; + }; + + hardware.keyboard.qmk.enable = true; + environment.systemPackages = with pkgs; [ + via + ]; + services.udev.packages = [ pkgs.via ]; + }; +} +