From bc0df6a800e79ca99a5a3b90bc2cd9f3ba9ee1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ryan4yin=20=7C=20=E4=BA=8C=E8=8A=B1?= Date: Sun, 1 Nov 2026 06:31:02 -0600 Subject: [PATCH] fix(openrgb): apply declarative off profile at boot (#502) Assisted-by: DeepSeek Harness (deepseek-flash) --- hosts/idols-ai/default.nix | 7 +------ hosts/idols-ai/openrgb/default.nix | 20 ++++++++++++++++++++ hosts/idols-ai/openrgb/off.json | 6 ++++++ 3 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 hosts/idols-ai/openrgb/default.nix create mode 100644 hosts/idols-ai/openrgb/off.json diff --git a/hosts/idols-ai/default.nix b/hosts/idols-ai/default.nix index 4cac06b9..f3a5beba 100644 --- a/hosts/idols-ai/default.nix +++ b/hosts/idols-ai/default.nix @@ -32,6 +32,7 @@ in ./preservation.nix ./secureboot.nix + ./openrgb ./restic.nix @@ -117,12 +118,6 @@ in # works without sudo. hardware.i2c.enable = true; - # The board's ARGB controller is a USB HID device (MSI Mystic Light, 1462:7e01). This - # module installs openrgb with its udev rules and runs `openrgb --server`, so the GUI and - # the CLI reach the board without root. `motherboard` needs no value here: it follows - # hardware.cpu.intel.updateMicrocode, which hardware-configuration.nix already sets. - services.hardware.openrgb.enable = true; - # Re-evaluate after the Insta360 Link firmware or the kernel's uvcvideo changes. powerManagement.resumeCommands = '' # Insta360 Link may stay enumerated with a stalled UVC endpoint after S3 resume. diff --git a/hosts/idols-ai/openrgb/default.nix b/hosts/idols-ai/openrgb/default.nix new file mode 100644 index 00000000..f6331023 --- /dev/null +++ b/hosts/idols-ai/openrgb/default.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +let + offProfile = ./off.json; +in +{ + # The MSI ARGB controller loses its state on power loss and reverts to the + # firmware default. Load an OpenRGB profile after detection so the service + # restores the desired Direct/black state on every boot. + services.hardware.openrgb = { + enable = true; + startupProfile = "off"; + }; + + # Keep the profile checked in, and install it before the server starts. An + # empty controller list with base_color = 0 makes OpenRGB apply black to every + # detected controller. + systemd.services.openrgb.preStart = '' + ${pkgs.coreutils}/bin/install -Dm0644 ${offProfile} /var/lib/OpenRGB/profiles/off.json + ''; +} diff --git a/hosts/idols-ai/openrgb/off.json b/hosts/idols-ai/openrgb/off.json new file mode 100644 index 00000000..e04317d1 --- /dev/null +++ b/hosts/idols-ai/openrgb/off.json @@ -0,0 +1,6 @@ +{ + "profile_name": "off", + "profile_version": 6, + "controllers": [], + "base_color": 0 +}