summaryrefslogtreecommitdiff
path: root/hosts/local/master/rgb.nix
blob: cd5ffae7eaa6cc889935f5cc087a154a7971f7bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  pkgs,
  lib,
  ...
}: let
  no-rgb = pkgs.writeScriptBin "no-rgb" ''
    #!/bin/sh
    NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | grep -E '^[0-9]+: ' | wc -l)

    for i in $(seq 0 $(($NUM_DEVICES - 1))); do
      ${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode static --color 000000
    done
  '';
in {
  # config = {
  # services.udev.packages = [pkgs.openrgb];
  services.hardware.openrgb = {
    enable = true;
    motherboard = "intel";
    package = pkgs.openrgb-with-all-plugins;
  };
  boot.kernelParams = ["acpi_enforce_resources=lax"];
  boot.kernelModules = ["i2c-dev" "i2c-pii4"];
  hardware.i2c.enable = true;
  environment.systemPackages = with pkgs; [
    i2c-tools
    liquidctl
  ];

  #   systemd.services.no-rgb = {
  #     description = "no-rgb";
  #     serviceConfig = {
  #       ExecStart = "${no-rgb}/bin/no-rgb";
  #       Type = "oneshot";
  #     };
  #     wantedBy = ["multi-user.target"];
  #   };
  # };
}