7 cfg = config.hardware.uni-sync;
10 meta.maintainers = with maintainers; [ yunfachi ];
12 options.hardware.uni-sync = {
13 enable = mkEnableOption "udev rules and software for Lian Li Uni Controllers";
14 package = mkPackageOption pkgs "uni-sync" { };
18 example = literalExpression ''
21 device_id = "VID:1111/PID:11111/SN:1111111111";
42 device_id = "VID:1010/PID:10101/SN:1010101010";
53 description = "List of controllers with their configurations.";
54 type = types.listOf (types.submodule {
56 device_id = mkOption {
58 example = "VID:1111/PID:11111/SN:1111111111";
59 description = "Unique device ID displayed at each startup.";
65 description = "Enable ARGB header sync.";
69 example = literalExpression ''
88 description = "List of channels connected to the controller.";
89 type = types.listOf (types.submodule {
92 type = types.enum [ "Manual" "PWM" ];
95 description = "\"PWM\" to enable PWM sync. \"Manual\" to set speed.";
101 description = "Fan speed as percentage (clamped between 0 and 100).";
111 config = mkIf cfg.enable {
112 environment.etc."uni-sync/uni-sync.json".text = mkIf (cfg.devices != [ ]) (builtins.toJSON { configs = cfg.devices; });
114 environment.systemPackages = [ cfg.package ];
115 services.udev.packages = [ cfg.package ];