1 { pkgs, lib, config, ... }:
6 cfg = config.services.hardware.openrgb;
8 options.services.hardware.openrgb = {
9 enable = mkEnableOption (lib.mdDoc "OpenRGB server");
13 default = pkgs.openrgb;
14 defaultText = literalMD "pkgs.openrgb";
15 description = lib.mdDoc "Set version of openrgb package to use.";
18 motherboard = mkOption {
19 type = types.nullOr (types.enum [ "amd" "intel" ]);
21 description = lib.mdDoc "CPU family of motherboard. Allows for addition motherboard i2c support.";
24 server.port = mkOption {
27 description = lib.mdDoc "Set server port of openrgb.";
32 config = mkIf cfg.enable {
33 environment.systemPackages = [ cfg.package ];
34 services.udev.packages = [ cfg.package ];
36 boot.kernelModules = [ "i2c-dev" ]
37 ++ lib.optionals (cfg.motherboard == "amd") [ "i2c-piix" ]
38 ++ lib.optionals (cfg.motherboard == "intel") [ "i2c-i801" ];
40 systemd.services.openrgb = {
41 description = "OpenRGB server daemon";
42 wantedBy = [ "multi-user.target" ];
45 ExecStart = "${cfg.package}/bin/openrgb --server --server-port ${toString cfg.server.port}";
51 meta.maintainers = with lib.maintainers; [ jonringer ];