about summary refs log tree commit diff stats
path: root/modules/system/services/adb/default.nix
blob: 4055dbb1a816c5d91cc4915836f9c04a50c11161 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  lib,
  config,
  ...
}: let
  cfg = config.soispha.adb;
in {
  options.soispha.adb = {
    enable = lib.mkEnableOption "Android adb bridge";
    user = lib.mkOption {
      type = lib.types.str;
      example = "soispha";
      default = "soispha";
      description = "Username to grant access to adb bridge";
    };
  };

  config = lib.mkIf cfg.enable {
    programs.adb.enable = true;
    users.users."${cfg.user}".extraGroups = ["adbusers"];
  };
}