summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-12-25 01:08:39 +0100
committerlassulus <lassulus@lassul.us>2022-12-25 01:08:39 +0100
commitc337e2593b9b28c4248cffc07edf530351df491f (patch)
tree029ada63863b2fc8e818772676a50eb502d7ca18 /lass
parent37e2e08a0ad47985de277a01d392a11fbe2242f0 (diff)
l mors.r: add autotether
Diffstat (limited to 'lass')
-rw-r--r--lass/1systems/mors/config.nix1
-rw-r--r--lass/2configs/autotether.nix16
2 files changed, 17 insertions, 0 deletions
diff --git a/lass/1systems/mors/config.nix b/lass/1systems/mors/config.nix
index dd479f267..6d0d177ec 100644
--- a/lass/1systems/mors/config.nix
+++ b/lass/1systems/mors/config.nix
@@ -41,6 +41,7 @@ with import <stockholm/lib>;
<stockholm/lass/2configs/ppp/umts-stick.nix>
# <stockholm/lass/2configs/remote-builder/morpheus.nix>
# <stockholm/lass/2configs/remote-builder/prism.nix>
+ <stockholm/lass/2configs/autotether.nix>
{
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 000000000..98712303e
--- /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";
+ };
+}