nixos/g810-led: support earlySetup in initrd

This commit is contained in:
toinux
2026-03-01 14:36:15 +01:00
parent e008392768
commit dc56ffef55
@@ -11,6 +11,7 @@ in
options = {
services.g810-led = {
enable = lib.mkEnableOption "g810-led, a Linux LED controller for some Logitech G Keyboards";
earlySetup = lib.mkEnableOption "g810-led in early stage initrd";
package = lib.mkPackageOption pkgs "g810-led" { };
@@ -38,6 +39,15 @@ in
config = lib.mkIf cfg.enable {
environment.etc."g810-led/profile".text = lib.mkIf (cfg.profile != null) cfg.profile;
boot.initrd = lib.mkIf (cfg.earlySetup && cfg.profile != null) {
services.udev.packages = [ cfg.package ];
services.udev.binPackages = [ cfg.package ];
systemd.contents = {
"/etc/g810-led/profile".text = cfg.profile;
};
};
services.udev.packages = [ cfg.package ];
};