From fdf0e9e18c95dfe15ed67b5861f9ab7b7f995c5e Mon Sep 17 00:00:00 2001 From: joy Date: Sun, 13 Oct 2024 13:54:32 +0200 Subject: [PATCH] only 1 option for games --- hosts/desktop/default.nix | 4 +--- modules/games/emulator/default.nix | 15 +++++++++++---- modules/games/norisk/default.nix | 5 +---- modules/games/steam/default.nix | 4 ++-- modules/games/suyu/default.nix | 5 +---- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index b90870b..45e8046 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -2,9 +2,7 @@ networking.hostName = "desktop"; openrgb.enable = true; - steam.enable = true; - suyu.enable = true; - norisk.enable = true; + games.enable = true; imports = [ ./hardware.nix diff --git a/modules/games/emulator/default.nix b/modules/games/emulator/default.nix index f7ad8ee..7875d44 100644 --- a/modules/games/emulator/default.nix +++ b/modules/games/emulator/default.nix @@ -1,5 +1,12 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - cemu - ]; +{ + pkgs, + lib, + config, + ... +}: { + config = lib.mkIf config.games.enable { + environment.systemPackages = with pkgs; [ + cemu + ]; + }; } diff --git a/modules/games/norisk/default.nix b/modules/games/norisk/default.nix index 2bf8541..41bd7aa 100644 --- a/modules/games/norisk/default.nix +++ b/modules/games/norisk/default.nix @@ -20,10 +20,7 @@ logourl = "https://raw.githubusercontent.com/NoRiskClient/noriskclient-launcher/refs/heads/main/src/images/norisk_logo.png"; logsha256 = "sha256-VwWwShUrT055mcabS8QTqqb8INgRB/08U2qEEIVYHlg="; in { - options = { - norisk.enable = lib.mkEnableOption ""; - }; - config = lib.mkIf config.norisk.enable { + config = lib.mkIf config.games.enable { environment.systemPackages = [ customPkgs.noriskclient ]; diff --git a/modules/games/steam/default.nix b/modules/games/steam/default.nix index 4d83d01..c51775e 100644 --- a/modules/games/steam/default.nix +++ b/modules/games/steam/default.nix @@ -5,9 +5,9 @@ ... }: { options = { - steam.enable = lib.mkEnableOption ""; + games.enable = lib.mkEnableOption ""; }; - config = lib.mkIf config.norisk.enable { + config = lib.mkIf config.games.enable { programs.steam.enable = true; nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ diff --git a/modules/games/suyu/default.nix b/modules/games/suyu/default.nix index a6a49ad..df31bda 100644 --- a/modules/games/suyu/default.nix +++ b/modules/games/suyu/default.nix @@ -18,10 +18,7 @@ }; }; in { - options = { - suyu.enable = lib.mkEnableOption ""; - }; - config = lib.mkIf config.suyu.enable { + config = lib.mkIf config.games.enable { environment.systemPackages = [ customPkgs.suyu ];