about summary refs log tree commit diff stats
path: root/modules/by-name/ad
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/ad')
-rw-r--r--modules/by-name/ad/adb/module.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/by-name/ad/adb/module.nix b/modules/by-name/ad/adb/module.nix
new file mode 100644
index 00000000..ec5d4be6
--- /dev/null
+++ b/modules/by-name/ad/adb/module.nix
@@ -0,0 +1,22 @@
+{
+  lib,
+  config,
+  ...
+}: let
+  cfg = config.soispha.services.adb;
+in {
+  options.soispha.services.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"];
+  };
+}