adb: init module
This commit is contained in:
parent
cb2de9354f
commit
08ebb422c5
|
@ -61,6 +61,7 @@
|
||||||
./misc/nixpkgs.nix
|
./misc/nixpkgs.nix
|
||||||
./misc/passthru.nix
|
./misc/passthru.nix
|
||||||
./misc/version.nix
|
./misc/version.nix
|
||||||
|
./programs/adb.nix
|
||||||
./programs/atop.nix
|
./programs/atop.nix
|
||||||
./programs/bash/bash.nix
|
./programs/bash/bash.nix
|
||||||
./programs/blcr.nix
|
./programs/blcr.nix
|
||||||
|
|
30
nixos/modules/programs/adb.nix
Normal file
30
nixos/modules/programs/adb.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
meta.maintainers = [ maintainers.mic92 ];
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
options = {
|
||||||
|
programs.adb = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
type = 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:
|
||||||
|
<code>users.extraUsers.alice.extraGroups = ["adbusers"];</code>
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
config = mkIf config.programs.adb.enable {
|
||||||
|
services.udev.packages = [ pkgs.android-udev-rules ];
|
||||||
|
environment.systemPackages = [ pkgs.androidenv.platformTools ];
|
||||||
|
users.extraGroups.adbusers = {};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue