mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
31 lines
788 B
Nix
31 lines
788 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
meta.maintainers = [ maintainers.mic92 ];
|
|
|
|
###### interface
|
|
options = {
|
|
programs.adb = {
|
|
enable = mkOption {
|
|
default = false;
|
|
type = types.bool;
|
|
description = ''
|
|
Whether to configure system to use Android Debug Bridge (adb).
|
|
To grant access to a user, it must be part of adbusers group:
|
|
<code>users.users.alice.extraGroups = ["adbusers"];</code>
|
|
'';
|
|
relatedPackages = [ ["androidenv" "platformTools"] ];
|
|
};
|
|
};
|
|
};
|
|
|
|
###### implementation
|
|
config = mkIf config.programs.adb.enable {
|
|
services.udev.packages = [ pkgs.android-udev-rules ];
|
|
environment.systemPackages = [ pkgs.androidenv.platformTools ];
|
|
users.groups.adbusers = {};
|
|
};
|
|
}
|