aboutsummaryrefslogtreecommitdiff
path: root/nixos/machine/spt-mox2.nix
blob: 71b95acbcb8ac158b384f19333b805e6a27386b1 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{ config, lib, pkgs, ... }:

with lib;

{

  config = {

    boot.kernelParams = [
      "pcie_aspm=off" # Fix for crashes due to SError Interrupt on ath10k load
    ];

    swapDevices = [{
      device = "/dev/disk/by-partlabel/NixTurrisSwap";
      priority = 1;
    }];

    networking.wirelessAP = {
      enable = true;
      environmentFile = "/run/secrets/hostapd.env";
      interfaces = {
        "wlp1s0" = {
          countryCode = "CZ";
          channel = 7;
          hwMode = "g";
          ht_capab = ["LDPC" "HT40+" "SHORT-GI-20" "SHORT-GI-40" "TX-STBC" "RX-STBC1" "MAX-AMSDU-7935" "DSSS_CCK-40"];
          ssid = "TurrisRules";
          bridge = "brlan";
          wpa = true;
          wpa3 = false;
          wpaPassphrase = "@PASS_TURRIS_RULES@";
          #bss = {
          #  "wlp1s0host" = {
          #    ssid = "KocoviGuest";
          #    wpa = true;
          #    wpaPassphrase = "@PASS_KOCOVI@";
          #  };
          #};
        };
      };
    };

    networking = {
      vlans = {
        "eth0.2" = {
          id = 2;
          interface = "eth0";
        };
      };
      bridges = {
        brlan = {
          interfaces = [
            "eth0"
          ];
        };
        brguest = {
          interfaces = [
            "eth0.2"
          ];
        };
      };
      interfaces.brlan = {
        ipv4 = {
          addresses = [{
            address = config.cynerd.hosts.spt.mox2;
            prefixLength = 24;
          }];
        };
      };
      defaultGateway = config.cynerd.hosts.spt.omnia;
      nameservers = [ config.cynerd.hosts.spt.omnia "1.1.1.1" "8.8.8.8" ];
      dhcpcd.allowInterfaces = [ "brlan" ];
    };
  };

}