feat(adb): service module

This commit is contained in:
arcnmx 2024-06-19 10:34:41 -07:00
parent 95e827221f
commit 594605ea69
6 changed files with 196 additions and 0 deletions

26
nixos/adb.nix Normal file
View file

@ -0,0 +1,26 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkDefault;
cfg = config.services.adb;
in {
services.adb = {
enable = mkDefault true;
settings = {
#a = mkDefault true;
};
devices = {
bedroom-tv.serial = "10.1.1.67:5555";
};
};
systemd.services = mkIf cfg.enable {
adb = {
environment.ADB_TRACE = mkDefault (toString [ "adb" ]);
};
};
networking.firewall.interfaces.lan = mkIf (cfg.enable && cfg.settings.a or false == true) {
allowedTCPPorts = [ cfg.port ];
};
}