nixpkgs/nixos/modules/services/hardware/g810-led.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.0 KiB
Nix
Raw Normal View History

2024-11-14 10:28:57 +00:00
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.g810-led;
in
{
options = {
services.g810-led = {
enable = lib.mkEnableOption "g810-led, a Linux LED controller for some Logitech G Keyboards";
package = lib.mkPackageOption pkgs "g810-led" { };
profile = lib.mkOption {
type = lib.types.nullOr lib.types.lines;
default = null;
example = ''
# G810-LED Profile (turn all keys on)
# Set all keys on
a ffffff
# Commit changes
c
'';
description = ''
Keyboard profile to apply at boot time.
The upstream repository provides [example configurations](https://github.com/MatMoul/g810-led/tree/master/sample_profiles).
'';
};
};
};
config = lib.mkIf cfg.enable {
2024-11-17 10:43:53 +00:00
environment.etc."g810-led/profile".text = lib.mkIf (cfg.profile != null) cfg.profile;
2024-11-14 10:28:57 +00:00
2024-11-17 10:43:53 +00:00
services.udev.packages = [ cfg.package ];
2024-11-14 10:28:57 +00:00
};
meta.maintainers = with lib.maintainers; [ GaetanLepage ];
}