1 { config, lib, pkgs, ... }:
5 let cfg = config.services.tp-auto-kbbl;
8 meta.maintainers = with maintainers; [ sebtm ];
11 services.tp-auto-kbbl = {
12 enable = mkEnableOption "auto toggle keyboard back-lighting on Thinkpads (and maybe other laptops) for Linux";
14 package = mkPackageOption pkgs "tp-auto-kbbl" { };
16 arguments = mkOption {
17 type = types.listOf types.str;
20 List of arguments appended to `./tp-auto-kbbl --device [device] [arguments]`
26 default = "/dev/input/event0";
27 description = "Device watched for activities.";
33 config = mkIf cfg.enable {
34 environment.systemPackages = [ cfg.package ];
36 systemd.services.tp-auto-kbbl = {
38 ExecStart = concatStringsSep " "
39 ([ "${cfg.package}/bin/tp-auto-kbbl" "--device ${cfg.device}" ] ++ cfg.arguments);
45 Description = "Auto toggle keyboard backlight";
46 Documentation = "https://github.com/saibotd/tp-auto-kbbl";
47 After = [ "dbus.service" ];
50 wantedBy = [ "multi-user.target" ];