summaryrefslogtreecommitdiff
path: root/hosts/toaster/network/default.nix
blob: ee0bdbef6bde9e136f8a2494021657dc13e32a14 (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
{ lib, pkgs, ... }:
{
  imports = [
    ./mullvad.nix
    ./dumpdvb.nix
    ./zw.nix
  ];

  environment.systemPackages = with pkgs; [
    iwgtk
    impala
  ];

  # kick out networkmanager
  networking.networkmanager.enable = lib.mkForce false;
  networking.useNetworkd = true;
  systemd.network.enable = true;

  networking = {
    hostName = "toaster";
    firewall.enable = true;
    wireguard.enable = true;
    wireless.iwd.enable = true;
  };

  services.resolved = {
    enable = true;
    dnssec = "false";
    fallbackDns = [
      "9.9.9.9"
      "2620:fe::fe"
      "149.112.112.112"
      "2620:fe::9"
    ];
  };

  # we might have no interwebs at all
  systemd.network.wait-online.enable = false;

  # uplinks
  systemd.network.networks = {
    "10-ether-uplink" = {
      matchConfig.Name = "enp1s0f0";
      networkConfig = {
        DHCP = "yes";
        IPv6AcceptRA = true;
      };
    };
    "10-dock-uplink" = {
      matchConfig.Name = "enp5s0f4u1u1";
      networkConfig = {
        DHCP = "yes";
        IPv6AcceptRA = true;
      };
      dhcpV4Config = {
        RouteMetric = 666;
      };
      dhcpV6Config = {
        RouteMetric = 666;
      };
    };
    "wlan-uplink" = {
      matchConfig.Name = "wlan0";
      networkConfig = {
        DHCP = "yes";
        IPv6AcceptRA = true;
      };
    };
  };

}