depot/third_party/nixpkgs/nixos/modules/programs/adb.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

27 lines
709 B
Nix

{ config, lib, pkgs, ... }:
{
meta.maintainers = [ lib.maintainers.mic92 ];
###### interface
options = {
programs.adb = {
enable = lib.mkOption {
default = false;
type = lib.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:
`users.users.alice.extraGroups = ["adbusers"];`
'';
};
};
};
###### implementation
config = lib.mkIf config.programs.adb.enable {
services.udev.packages = [ pkgs.android-udev-rules ];
environment.systemPackages = [ pkgs.android-tools ];
users.groups.adbusers = {};
};
}