nixos/g810-led: init (#355884)

This commit is contained in:
Masum Reza 2024-11-15 10:03:47 +05:30 committed by GitHub
commit c04b381470
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,45 @@
{
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 {
environment.etc."g810-led/profile" = lib.mkIf (cfg.profile != null) cfg.profile;
services.udev.packages = [ config.package ];
};
meta.maintainers = with lib.maintainers; [ GaetanLepage ];
}