]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/aubergine/networking/lte.nix
otpclient: install in graphical setup
[julm/julm-nix.git] / hosts / aubergine / networking / lte.nix
1 { pkgs, config, ... }:
2 with (import ./names-and-numbers.nix);
3 let
4 inherit (config.users) users;
5 in
6 {
7 networking.nftables.ruleset = ''
8 table inet filter {
9 chain input {
10 iifname ${lteIface} jump input-net
11 iifname ${lteIface} log level warn prefix "input-net: " counter drop
12 }
13 chain output-net {
14 ip daddr 10.151.0.1 tcp dport 8080 counter accept \
15 comment "mmsd: Prixtel/SFR"
16 }
17 chain output {
18 oifname ${lteIface} jump output-net
19 oifname ${lteIface} log level warn prefix "output-net: " counter drop
20 }
21 chain forward-to-net {
22 }
23 chain forward-from-net {
24 }
25 chain forward-to-net { }
26 chain forward-from-net { }
27 chain forward {
28 iifname { ${wifiIface}, ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } oifname ${lteIface} goto forward-to-net
29 iifname ${lteIface} oifname { ${wifiIface}, ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } goto forward-from-net
30 }
31 }
32 table inet nat {
33 chain postrouting {
34 iifname { ${wifiIface}, ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } oifname ${lteIface} masquerade
35 }
36 }
37 '';
38 services.mmsd.enable = true;
39 services.mmsd.extraArgs = [ "--debug" ];
40 systemd.services.NetworkManager.wants = [ "ModemManager.service" ];
41 services.dbus.packages = [ pkgs.dconf ];
42 programs.dconf.enable = true;
43 environment.etc."NetworkManager/system-connections/Prixtel.nmconnection" = {
44 mode = "600";
45 text = ''
46 [connection]
47 id=Prixtel
48 uuid=b223f550-dff1-4ba3-9755-cd4557faaa5a
49 type=gsm
50 autoconnect=true
51 autoconnect-retries=0
52 permissions=user:${users.julm.name}:;
53
54 [gsm]
55 apn=sl2sfr
56 number=*99#
57 #home-only=true
58
59 [ppp]
60
61 [ipv4]
62 method=auto
63 dhcp-send-hostname=false
64
65 [ipv6]
66 method=auto
67 addr-gen-mode=stable-privacy
68 ip6-privacy=2
69 dhcp-send-hostname=false
70
71 [proxy]
72 '';
73 };
74 environment.systemPackages = [
75 pkgs.modem-manager-gui
76 pkgs.libmbim
77 pkgs.chatty
78 pkgs.gnome.gnome-contacts
79 pkgs.picocom
80 pkgs.calls
81 pkgs.dfeet
82 # https://gitlab.com/mobian1/callaudiod/-/issues/26
83 # https://gitlab.com/mobian1/callaudiod/-/issues/27
84 pkgs.callaudiod
85 ];
86 }