openrgb: add startupProfile option to service (#408517)

This commit is contained in:
Masum Reza
2025-09-26 13:00:42 +00:00
committed by GitHub
+8 -1
View File
@@ -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";
};
};