summary refs log blame commit diff
path: root/nixos/modules/programs/adb.nix
blob: e5b0abd9fcfeda8e96ecbb2b3a8f3496395c9aab (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                           
                          
                                  

                                                                        
                                                         







                                                         
                                                        
                               

    
{ config, lib, pkgs, ... }:

with lib;

{
  meta.maintainers = [ maintainers.mic92 ];

  ###### interface
  options = {
    programs.adb = {
      enable = mkOption {
        default = false;
        type = types.bool;
        description = lib.mdDoc ''
          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 = mkIf config.programs.adb.enable {
    services.udev.packages = [ pkgs.android-udev-rules ];
    environment.systemPackages = [ pkgs.android-tools ];
    users.groups.adbusers = {};
  };
}