nixos/openrgb: systemd service cleanup

- Run service after lm_sensors:
  Align with upstream's systemd ordering.
- Sync service description with upstream.
- Cleanup `ExecStart` using `escapeShellArgs`:
  Avoid ad-hoc `toString` and `escapeShellArg` by wrapping the whole
  thing in `escapeShellArgs`.
This commit is contained in:
Matt Sturgeon
2026-01-08 20:25:05 +00:00
parent e1041316cb
commit e1eb3592c2
+17 -5
View File
@@ -59,16 +59,28 @@ in
++ lib.optionals (cfg.motherboard == "intel") [ "i2c-i801" ];
systemd.services.openrgb = {
description = "OpenRGB server daemon";
after = [ "network.target" ];
description = "OpenRGB SDK Server";
after = [
"network.target"
"lm_sensors.service"
];
wants = [ "dev-usb.device" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
StateDirectory = "OpenRGB";
WorkingDirectory = "/var/lib/OpenRGB";
ExecStart =
"${cfg.package}/bin/openrgb --server --server-port ${toString cfg.server.port}"
+ lib.optionalString (builtins.isString cfg.startupProfile) " --profile ${lib.escapeShellArg cfg.startupProfile}";
ExecStart = lib.escapeShellArgs (
[
(lib.getExe cfg.package)
"--server"
"--server-port"
cfg.server.port
]
++ lib.optionals (lib.isString cfg.startupProfile) [
"--profile"
cfg.startupProfile
]
);
Restart = "always";
};
};