]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/aubergine/networking/lte.nix
gnupg: keys.mayfirst.org is gone, use keys.openpgp.org
[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
53 [gsm]
54 apn=sl2sfr
55 number=*99#
56 #home-only=true
57
58 [ppp]
59
60 [ipv4]
61 method=auto
62 dhcp-send-hostname=false
63
64 [ipv6]
65 method=auto
66 addr-gen-mode=stable-privacy
67 ip6-privacy=2
68 dhcp-send-hostname=false
69
70 [proxy]
71 '';
72 };
73 environment.systemPackages = [
74 pkgs.modem-manager-gui
75 pkgs.libmbim
76 pkgs.chatty
77 pkgs.gnome.gnome-contacts
78 pkgs.picocom
79 pkgs.calls
80 pkgs.dfeet
81 # https://gitlab.com/mobian1/callaudiod/-/issues/26
82 # https://gitlab.com/mobian1/callaudiod/-/issues/27
83 pkgs.callaudiod
84 ];
85 }