aboutsummaryrefslogtreecommitdiff
path: root/nixos/machine/spt-omnia.nix
blob: bf72a6ecd72c8e484e3eb29c28d7b759964891ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
  config,
  lib,
  pkgs,
  ...
}:
with lib; {
  config = {
    cynerd = {
      router = {
        enable = true;
        wan = "pppoe-wan";
        lanIP = config.cynerd.hosts.spt.omnia;
      };
      wifiAP.spt = {
        enable = true;
        ar9287.interface = "wlp3s0";
        qca988x.interface = "wlp2s0";
      };
      openvpn.oldpersonal = true;
      monitoring.speedtest = true;
    };

    networking.vlans."end2.848" = {
      id = 848;
      interface = "end2";
    };
    # TODO pppd service requires end2.848 interface
    services.pppd = {
      enable = true;
      peers."wan".config = ''
        plugin pppoe.so end2.848
        ifname pppoe-wan
        lcp-echo-interval 1
        lcp-echo-failure 5
        lcp-echo-adaptive
        +ipv6
        defaultroute
        defaultroute6
        usepeerdns
        maxfail 1
        user metronet
        password metronet
      '';
    };

    networking.bridges = {
      brlan.interfaces = ["lan0" "lan1" "lan2" "lan3" "lan4"];
    };

    services.syncthing = {
      enable = true;
      openDefaultPorts = true;

      overrideDevices = false;
      overrideFolders = false;

      dataDir = "/data";
    };
  };
}