summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hosts/kaworu/default.nix5
-rw-r--r--options.nix9
-rw-r--r--system/gaming/default.nix6
-rw-r--r--system/gaming/openrgb.nix20
4 files changed, 33 insertions, 7 deletions
diff --git a/hosts/kaworu/default.nix b/hosts/kaworu/default.nix
index c608607..a39cfe0 100644
--- a/hosts/kaworu/default.nix
+++ b/hosts/kaworu/default.nix
@@ -29,7 +29,10 @@
};
gaming = {
enable = true;
- openrgb.enable = true;
+ openrgb = {
+ enable = true;
+ profile = "main";
+ };
homestuck.enable = true;
minecraft.enable = true;
steam.enable = true;
diff --git a/options.nix b/options.nix
index e1208d7..8424716 100644
--- a/options.nix
+++ b/options.nix
@@ -508,7 +508,14 @@ in {
#
gaming = {
enable = mkEnableOption "Enable gaming optimizations";
- openrgb.enable = mkEnableOption "Enable OpenRGB support";
+ openrgb = {
+ enable = mkEnableOption "Enable OpenRGB support";
+ profile = mkOption {
+ description = "OpenRGB to apply on startup";
+ default = null;
+ type = with lib; types.nullOr types.str;
+ };
+ };
homestuck.enable = mkEnableOption "Install the unofficial homestuck collection.";
minecraft.enable = mkEnableOption "Install the minecraft block game.";
steam.enable = mkEnableOption "Install the steam game launcher.";
diff --git a/system/gaming/default.nix b/system/gaming/default.nix
index ca97345..13d2119 100644
--- a/system/gaming/default.nix
+++ b/system/gaming/default.nix
@@ -8,6 +8,7 @@
cfg = config.gaming;
in {
imports = [
+ ./openrgb.nix
./steam.nix
];
@@ -35,11 +36,6 @@ in {
rulesProvider = pkgs.ananicy-rules-cachyos;
};
- services.hardware.openrgb = {
- enable = cfg.openrgb.enable;
- package = pkgs.openrgb-with-all-plugins;
- };
-
services.scx = {
enable = true;
package = pkgs.scx.rustscheds;
diff --git a/system/gaming/openrgb.nix b/system/gaming/openrgb.nix
new file mode 100644
index 0000000..d9c64c2
--- /dev/null
+++ b/system/gaming/openrgb.nix
@@ -0,0 +1,20 @@
+{
+ lib,
+ config,
+ pkgs,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.gaming.openrgb;
+in {
+ config = mkIf cfg.enable {
+ services.hardware.openrgb = {
+ enable = cfg.enable;
+ package = pkgs.openrgb-with-all-plugins;
+ startupProfile = cfg.profile;
+ };
+
+ hardware.i2c.enable = true;
+ boot.kernelModules = ["i2c-dev"];
+ };
+}