mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Add OpenRGB
This commit is contained in:
parent
3256def44c
commit
e277a2e875
2 changed files with 30 additions and 1 deletions
|
|
@ -10,7 +10,7 @@
|
||||||
cfg = config.mods;
|
cfg = config.mods;
|
||||||
in {
|
in {
|
||||||
# Hardware
|
# Hardware
|
||||||
imports = [./hardware-configuration.nix];
|
imports = [./hardware-configuration.nix ./openrgb.nix];
|
||||||
|
|
||||||
environment.systemPackages = with inputs.nix-alien.packages.${system}; [
|
environment.systemPackages = with inputs.nix-alien.packages.${system}; [
|
||||||
nix-alien
|
nix-alien
|
||||||
|
|
|
||||||
29
hosts/muon/openrgb.nix
Normal file
29
hosts/muon/openrgb.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
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];
|
||||||
|
boot.kernelModules = ["i2c-dev"];
|
||||||
|
hardware.i2c.enable = true;
|
||||||
|
|
||||||
|
systemd.services.no-rgb = {
|
||||||
|
description = "no-rgb";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${no-rgb}/bin/no-rgb";
|
||||||
|
Type = "oneshot";
|
||||||
|
};
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue