summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-10-03 12:19:13 +0200
committertv <tv@krebsco.de>2020-10-03 13:02:21 +0200
commit5742f67bc3fefc669ba610bd39b55f97320bb517 (patch)
treeea07b526f694d7c902d3f74612ec814d02f08503
parent41afed6fd74178a5a1fc3c4b5277cbf1f0b5efbd (diff)
tv ppp: add o2 config
-rw-r--r--tv/2configs/ppp.nix34
-rw-r--r--tv/dummy_secrets/o2.pin1
2 files changed, 34 insertions, 1 deletions
diff --git a/tv/2configs/ppp.nix b/tv/2configs/ppp.nix
index 0222734..ecb17c3 100644
--- a/tv/2configs/ppp.nix
+++ b/tv/2configs/ppp.nix
@@ -1,2 +1,34 @@
-{ pkgs, ... }: {
+{ pkgs, ... }: let
+ lib = import <stockholm/lib>;
+ cfg = {
+ pin = "@${toString <secrets/o2.pin>}";
+ ttys.ppp = "/dev/ttyACM0";
+ };
+in {
+ environment.etc."ppp/peers/o2".text = /* sh */ ''
+ ${cfg.ttys.ppp}
+ 921600
+ crtscts
+ defaultroute
+ holdoff 10
+ lock
+ maxfail 0
+ noauth
+ nodetach
+ noipdefault
+ passive
+ persist
+ usepeerdns
+ connect "${pkgs.ppp}/bin/chat ''${DEBUG+-v} -Ss -f ${pkgs.writeText "o2.chat" /* sh */ ''
+ ABORT "BUSY"
+ ABORT "NO CARRIER"
+ REPORT CONNECT
+ "*EMRDY: 1"
+ ATZ OK
+ AT+CFUN=1 OK
+ ${cfg.pin} TIMEOUT 2 ERROR-AT-OK
+ AT+CGDCONT=1,\042IP\042,\042internet\042 OK
+ ATDT*99***1# CONNECT
+ ''}"
+ '';
}
diff --git a/tv/dummy_secrets/o2.pin b/tv/dummy_secrets/o2.pin
new file mode 100644
index 0000000..53a3137
--- /dev/null
+++ b/tv/dummy_secrets/o2.pin
@@ -0,0 +1 @@
+AT