Guide to setup openrgb on NixOS

it will determine the order, 99 is considered the last to be executed. But for this case, it probably doesn’t matter

nixos-rebuild switch should, but it will definitely take affect next boot

the modprobe commands should be replaced with boot.kernelModules:

  boot.kernelModules = [ "i2c-dev" "i2c-piix4" ];

And then all of this should get applied with sudo nixos-rebuild switch

Altogether, I would do something like (haven’t verified that this works):

{ config, pkgs, ... }:

let
  openrgb-rules = builtins.fetchurl {
    url = "https://gitlab.com/CalcProgrammer1/OpenRGB/-/raw/master/60-openrgb.rules";
  }
in {

  ...
  boot.kernelModules = [ "i2c-dev" "i2c-piix4" ];
  
  services.udev.extraRules =  builtins.readFile openrgb-rules;
  ...

then just do nixos-rebuild to apply the changes.

3 Likes