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