lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 23.11-beta 60 lines 1.8 kB view raw
1{ pkgs, lib, config, ... }: 2 3with lib; 4 5let 6 cfg = config.services.hardware.openrgb; 7in { 8 options.services.hardware.openrgb = { 9 enable = mkEnableOption (lib.mdDoc "OpenRGB server"); 10 11 package = mkOption { 12 type = types.package; 13 default = pkgs.openrgb; 14 defaultText = literalMD "pkgs.openrgb"; 15 description = lib.mdDoc "Set version of openrgb package to use."; 16 }; 17 18 motherboard = mkOption { 19 type = types.nullOr (types.enum [ "amd" "intel" ]); 20 default = if config.hardware.cpu.intel.updateMicrocode then "intel" 21 else if config.hardware.cpu.amd.updateMicrocode then "amd" 22 else null; 23 defaultText = literalMD '' 24 if config.hardware.cpu.intel.updateMicrocode then "intel" 25 else if config.hardware.cpu.amd.updateMicrocode then "amd" 26 else null; 27 ''; 28 description = lib.mdDoc "CPU family of motherboard. Allows for addition motherboard i2c support."; 29 }; 30 31 server.port = mkOption { 32 type = types.port; 33 default = 6742; 34 description = lib.mdDoc "Set server port of openrgb."; 35 }; 36 37 }; 38 39 config = mkIf cfg.enable { 40 environment.systemPackages = [ cfg.package ]; 41 services.udev.packages = [ cfg.package ]; 42 43 boot.kernelModules = [ "i2c-dev" ] 44 ++ lib.optionals (cfg.motherboard == "amd") [ "i2c-piix4" ] 45 ++ lib.optionals (cfg.motherboard == "intel") [ "i2c-i801" ]; 46 47 systemd.services.openrgb = { 48 description = "OpenRGB server daemon"; 49 wantedBy = [ "multi-user.target" ]; 50 serviceConfig = { 51 StateDirectory = "OpenRGB"; 52 WorkingDirectory = "/var/lib/OpenRGB"; 53 ExecStart = "${cfg.package}/bin/openrgb --server --server-port ${toString cfg.server.port}"; 54 Restart = "always"; 55 }; 56 }; 57 }; 58 59 meta.maintainers = with lib.maintainers; [ jonringer ]; 60}