2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2024-05-15 15:35:15 +00:00
|
|
|
meta.maintainers = [ lib.maintainers.mic92 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
programs.adb = {
|
2024-05-15 15:35:15 +00:00
|
|
|
enable = lib.mkOption {
|
2020-04-24 23:36:52 +00:00
|
|
|
default = false;
|
2024-05-15 15:35:15 +00:00
|
|
|
type = lib.types.bool;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Whether to configure system to use Android Debug Bridge (adb).
|
|
|
|
To grant access to a user, it must be part of adbusers group:
|
2022-08-12 12:06:08 +00:00
|
|
|
`users.users.alice.extraGroups = ["adbusers"];`
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
2024-05-15 15:35:15 +00:00
|
|
|
config = lib.mkIf config.programs.adb.enable {
|
2020-04-24 23:36:52 +00:00
|
|
|
services.udev.packages = [ pkgs.android-udev-rules ];
|
2022-04-03 18:54:34 +00:00
|
|
|
environment.systemPackages = [ pkgs.android-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
users.groups.adbusers = {};
|
|
|
|
};
|
|
|
|
}
|