2016-10-31 10:25:50 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
{
|
2024-04-17 11:37:58 +00:00
|
|
|
meta.maintainers = [ lib.maintainers.mic92 ];
|
2016-10-31 10:25:50 +00:00
|
|
|
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
programs.adb = {
|
2024-04-17 11:37:58 +00:00
|
|
|
enable = lib.mkOption {
|
2016-10-31 10:25:50 +00:00
|
|
|
default = false;
|
2024-04-17 11:37:58 +00:00
|
|
|
type = lib.types.bool;
|
2016-10-31 10:25:50 +00:00
|
|
|
description = ''
|
|
|
|
Whether to configure system to use Android Debug Bridge (adb).
|
|
|
|
To grant access to a user, it must be part of adbusers group:
|
2018-06-29 23:58:35 +00:00
|
|
|
`users.users.alice.extraGroups = ["adbusers"];`
|
2016-10-31 10:25:50 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
2024-04-17 11:37:58 +00:00
|
|
|
config = lib.mkIf config.programs.adb.enable {
|
2016-10-31 10:25:50 +00:00
|
|
|
services.udev.packages = [ pkgs.android-udev-rules ];
|
2021-08-28 15:22:46 +00:00
|
|
|
environment.systemPackages = [ pkgs.android-tools ];
|
2018-06-29 23:58:35 +00:00
|
|
|
users.groups.adbusers = { };
|
2016-10-31 10:25:50 +00:00
|
|
|
};
|
|
|
|
}
|