Files
nixpkgs/nixos/modules/services/misc/tp-auto-kbbl.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

65 lines
1.4 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.tp-auto-kbbl;
in
{
meta.maintainers = with lib.maintainers; [ sebtm ];
options = {
services.tp-auto-kbbl = {
enable = lib.mkEnableOption "auto toggle keyboard back-lighting on Thinkpads (and maybe other laptops) for Linux";
package = lib.mkPackageOption pkgs "tp-auto-kbbl" { };
arguments = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = ''
List of arguments appended to `./tp-auto-kbbl --device [device] [arguments]`
'';
};
device = lib.mkOption {
type = lib.types.str;
default = "/dev/input/event0";
description = "Device watched for activities.";
};
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
services.upower.enable = true;
systemd.services.tp-auto-kbbl = {
serviceConfig = {
ExecStart = lib.concatStringsSep " " (
[
"${cfg.package}/bin/tp-auto-kbbl"
"--device ${cfg.device}"
]
++ cfg.arguments
);
Restart = "always";
Type = "simple";
};
unitConfig = {
Description = "Auto toggle keyboard backlight";
Documentation = "https://github.com/saibotd/tp-auto-kbbl";
After = [ "dbus.service" ];
};
wantedBy = [ "multi-user.target" ];
};
};
}