summaryrefslogtreecommitdiffstats
path: root/configs/networkd.nix
blob: d9f93a0f6af14d8e2af993013f4f407d95dbfda5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ config, lib, mylib, ... }: {
  # often hangs
  systemd.network.wait-online.enable = lib.mkDefault false;

  networking.useNetworkd = true;
  networking.useDHCP = false;

  # Don't use DNS servers received from DHCP servers.  The networks are
  # called 40-NAME like the ones from
  # <nixpkgs/nixos/modules/tasks/network-interfaces-systemd.nix>, so the
  # settings merge into them.
  systemd.network.networks =
    mylib.genAttrs'
      (builtins.attrNames config.networking.interfaces)
      (name: lib.nameValuePair "40-${name}" {
        dhcpV4Config.UseDNS = lib.mkDefault false;
        dhcpV6Config.UseDNS = lib.mkDefault false;
      });
}