diff --git a/hosts/Styx/configuration.nix b/hosts/Styx/configuration.nix index b71f770..eda83da 100644 --- a/hosts/Styx/configuration.nix +++ b/hosts/Styx/configuration.nix @@ -1,6 +1,7 @@ { inputs, pkgs, + config, ... }: @@ -118,6 +119,16 @@ server.port = 6742; }; + # Windows' vendor RGB app tells the ARGB controllers to switch off before + # the system reaches S5; there's no equivalent on Linux, so without this the + # LEDs just retain their last state straight through poweroff/reboot. + # ExecStop runs while the openrgb SDK server (the service's main process) is + # still alive -- systemd waits for it to finish before killing the main + # process -- so this client call can still reach the server and switch every + # device off before the service, and the system, goes down. + systemd.services.openrgb.serviceConfig.ExecStop = + "${pkgs.openrgb-with-all-plugins}/bin/openrgb --mode off --client 127.0.0.1:${toString config.services.hardware.openrgb.server.port}"; + # The board's ACPI tables reserve I/O ports 0xB00-0xB0F for an OpRegion # (\GSA1.SMBI), which overlaps the AMD FCH SMBus controller's I/O range. # With strict ACPI resource enforcement (the default), the kernel refuses