9 cfg = config.hardware.uni-sync;
12 meta.maintainers = with maintainers; [ yunfachi ];
14 options.hardware.uni-sync = {
15 enable = mkEnableOption "udev rules and software for Lian Li Uni Controllers";
16 package = mkPackageOption pkgs "uni-sync" { };
20 example = literalExpression ''
23 device_id = "VID:1111/PID:11111/SN:1111111111";
44 device_id = "VID:1010/PID:10101/SN:1010101010";
55 description = "List of controllers with their configurations.";
59 device_id = mkOption {
61 example = "VID:1111/PID:11111/SN:1111111111";
62 description = "Unique device ID displayed at each startup.";
68 description = "Enable ARGB header sync.";
72 example = literalExpression ''
91 description = "List of channels connected to the controller.";
102 description = "\"PWM\" to enable PWM sync. \"Manual\" to set speed.";
108 description = "Fan speed as percentage (clamped between 0 and 100).";
120 config = mkIf cfg.enable {
121 environment.etc."uni-sync/uni-sync.json".text = mkIf (cfg.devices != [ ]) (
122 builtins.toJSON { configs = cfg.devices; }
125 environment.systemPackages = [ cfg.package ];
126 services.udev.packages = [ cfg.package ];