From c337e2593b9b28c4248cffc07edf530351df491f Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 25 Dec 2022 01:08:39 +0100 Subject: l mors.r: add autotether --- lass/1systems/mors/config.nix | 1 + lass/2configs/autotether.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 lass/2configs/autotether.nix diff --git a/lass/1systems/mors/config.nix b/lass/1systems/mors/config.nix index dd479f26..6d0d177e 100644 --- a/lass/1systems/mors/config.nix +++ b/lass/1systems/mors/config.nix @@ -41,6 +41,7 @@ with import ; # # + { krebs.iptables.tables.filter.INPUT.rules = [ #risk of rain diff --git a/lass/2configs/autotether.nix b/lass/2configs/autotether.nix new file mode 100644 index 00000000..98712303 --- /dev/null +++ b/lass/2configs/autotether.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: +{ + systemd.services.usb_tether = { + script = '' + ${pkgs.android-tools}/bin/adb -s QV770FAMEK wait-for-device + ${pkgs.android-tools}/bin/adb -s QV770FAMEK shell svc usb setFunctions rndis + ''; + }; + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="usb", ENV{PRODUCT}=="fce/320d/510", TAG+="systemd", ENV{SYSTEMD_WANTS}="usb_tether.service" + ''; + systemd.network.networks.android = { + matchConfig.Name = "enp0s20u1"; + DHCP = "yes"; + }; +} -- cgit v1.2.3