diff --git a/nixos/modules/services/hardware/openrgb.nix b/nixos/modules/services/hardware/openrgb.nix index ecbea501fd24..9d5d598db913 100644 --- a/nixos/modules/services/hardware/openrgb.nix +++ b/nixos/modules/services/hardware/openrgb.nix @@ -41,6 +41,11 @@ in description = "Set server port of openrgb."; }; + startupProfile = lib.mkOption { + type = lib.types.nullOr (lib.types.str); + default = null; + description = "The profile file to load from \"/var/lib/OpenRGB\" at startup."; + }; }; config = lib.mkIf cfg.enable { @@ -61,7 +66,9 @@ in serviceConfig = { StateDirectory = "OpenRGB"; WorkingDirectory = "/var/lib/OpenRGB"; - ExecStart = "${cfg.package}/bin/openrgb --server --server-port ${toString cfg.server.port}"; + ExecStart = + "${cfg.package}/bin/openrgb --server --server-port ${toString cfg.server.port}" + + lib.optionalString (builtins.isString cfg.startupProfile) " --profile ${lib.escapeShellArg cfg.startupProfile}"; Restart = "always"; }; };