about summary refs log tree commit diff stats
path: root/sys/svcs/adb/default.nix
blob: 42eefcb83e90340871fb0349e3b012c7630c767d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  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"];
    };
}