tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
0
fork
atom
overview
issues
pulls
pipelines
tp-auto-kbbl: init at 0.1.5
Sebastian Sellmeier
4 years ago
f0d1af9b
c21ba4f7
+94
4 changed files
expand all
collapse all
unified
split
nixos
modules
module-list.nix
services
misc
tp-auto-kbbl.nix
pkgs
tools
system
tp-auto-kbbl
default.nix
top-level
all-packages.nix
+1
nixos/modules/module-list.nix
reviewed
···
592
592
./services/misc/sysprof.nix
593
593
./services/misc/taskserver
594
594
./services/misc/tiddlywiki.nix
595
595
+
./services/misc/tp-auto-kbbl.nix
595
596
./services/misc/tzupdate.nix
596
597
./services/misc/uhub.nix
597
598
./services/misc/weechat.nix
+58
nixos/modules/services/misc/tp-auto-kbbl.nix
reviewed
···
1
1
+
{ config, lib, pkgs, ... }:
2
2
+
3
3
+
with lib;
4
4
+
5
5
+
let cfg = config.services.tp-auto-kbbl;
6
6
+
7
7
+
in {
8
8
+
meta.maintainers = with maintainers; [ sebtm ];
9
9
+
10
10
+
options = {
11
11
+
services.tp-auto-kbbl = {
12
12
+
enable = mkEnableOption "Auto toggle keyboard back-lighting on Thinkpads (and maybe other laptops) for Linux";
13
13
+
14
14
+
package = mkOption {
15
15
+
type = types.package;
16
16
+
default = pkgs.tp-auto-kbbl;
17
17
+
defaultText = literalExample "pkgs.tp-auto-kbbl";
18
18
+
description = "Package providing <command>tp-auto-kbbl</command>.";
19
19
+
};
20
20
+
21
21
+
arguments = mkOption {
22
22
+
type = types.listOf types.str;
23
23
+
default = [ ];
24
24
+
description = ''
25
25
+
List of arguments appended to <literal>./tp-auto-kbbl --device [device] [arguments]</literal>
26
26
+
'';
27
27
+
};
28
28
+
29
29
+
device = mkOption {
30
30
+
type = types.str;
31
31
+
default = "/dev/input/event0";
32
32
+
description = "Device watched for activities.";
33
33
+
};
34
34
+
35
35
+
};
36
36
+
};
37
37
+
38
38
+
config = mkIf cfg.enable {
39
39
+
environment.systemPackages = [ cfg.package ];
40
40
+
41
41
+
systemd.services.tp-auto-kbbl = {
42
42
+
serviceConfig = {
43
43
+
ExecStart = concatStringsSep " "
44
44
+
([ "${cfg.package}/bin/tp-auto-kbbl" "--device ${cfg.device}" ] ++ cfg.arguments);
45
45
+
Restart = "always";
46
46
+
Type = "simple";
47
47
+
};
48
48
+
49
49
+
unitConfig = {
50
50
+
Description = "Auto toggle keyboard backlight";
51
51
+
Documentation = "https://github.com/saibotd/tp-auto-kbbl";
52
52
+
After = [ "dbus.service" ];
53
53
+
};
54
54
+
55
55
+
wantedBy = [ "multi-user.target" ];
56
56
+
};
57
57
+
};
58
58
+
}
+33
pkgs/tools/system/tp-auto-kbbl/default.nix
reviewed
···
1
1
+
{ lib
2
2
+
, fetchFromGitHub
3
3
+
, rustPlatform
4
4
+
, dbus
5
5
+
, pkg-config
6
6
+
, openssl
7
7
+
, libevdev
8
8
+
}:
9
9
+
10
10
+
rustPlatform.buildRustPackage rec {
11
11
+
pname = "tp-auto-kbbl";
12
12
+
version = "0.1.5";
13
13
+
14
14
+
src = fetchFromGitHub {
15
15
+
owner = "saibotd";
16
16
+
repo = pname;
17
17
+
rev = version;
18
18
+
sha256 = "0db9h15zyz2sq5r1qmq41288i54rhdl30qy08snpsh6sx2q4443y";
19
19
+
};
20
20
+
21
21
+
cargoSha256 = "0m1gcvshbd9cfb0v6f86kbcfjxb4p9cxynmxgi4nxkhaszfyf56c";
22
22
+
23
23
+
nativeBuildInputs = [ pkg-config ];
24
24
+
buildInputs = [ dbus libevdev openssl ];
25
25
+
26
26
+
meta = with lib; {
27
27
+
description = "Auto toggle keyboard back-lighting on Thinkpads (and maybe other laptops) for Linux";
28
28
+
homepage = "https://github.com/saibotd/tp-auto-kbbl";
29
29
+
license = licenses.mit;
30
30
+
maintainers = with maintainers; [ sebtm ];
31
31
+
platforms = platforms.linux;
32
32
+
};
33
33
+
}
+2
pkgs/top-level/all-packages.nix
reviewed
···
32267
32267
32268
32268
thinkfan = callPackage ../tools/system/thinkfan { };
32269
32269
32270
32270
+
tp-auto-kbbl = callPackage ../tools/system/tp-auto-kbbl { };
32271
32271
+
32270
32272
tup = callPackage ../development/tools/build-managers/tup { };
32271
32273
32272
32274
tusk = callPackage ../applications/office/tusk { };