cleanup
This commit is contained in:
33
etcnixos/no-rgb.nix
Normal file
33
etcnixos/no-rgb.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
systemd.services.no-rgb =
|
||||
let
|
||||
no-rgb = pkgs.writeScriptBin "no-rgb" ''
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | ${pkgs.gnugrep}/bin/grep -E '^[0-9]+: ' | ${pkgs.coreutils}/bin/wc -l)
|
||||
|
||||
for i in $(${pkgs.coreutils}/bin/seq 0 $(($NUM_DEVICES - 1))); do
|
||||
${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode direct --color 000000
|
||||
done
|
||||
'';
|
||||
in
|
||||
{
|
||||
description = "disable rgb";
|
||||
serviceConfig = {
|
||||
ExecStart = "${no-rgb}/bin/no-rgb";
|
||||
Type = "oneshot";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
services.hardware.openrgb.enable = true;
|
||||
services.udev.packages = [ pkgs.openrgb ];
|
||||
hardware.i2c.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
openrgb-with-all-plugins
|
||||
];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user