1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8{
9 meta.maintainers = [ lib.maintainers.mic92 ];
10
11 ###### interface
12 options = {
13 programs.adb = {
14 enable = lib.mkOption {
15 default = false;
16 type = lib.types.bool;
17 description = ''
18 Whether to configure system to use Android Debug Bridge (adb).
19 To grant access to a user, it must be part of adbusers group:
20 `users.users.alice.extraGroups = ["adbusers"];`
21 '';
22 };
23 };
24 };
25
26 ###### implementation
27 config = lib.mkIf config.programs.adb.enable {
28 services.udev.packages = [ pkgs.android-udev-rules ];
29 environment.systemPackages = [ pkgs.android-tools ];
30 users.groups.adbusers = { };
31 };
32}