2023-01-06 18:03:46 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
|
2023-07-22 13:28:19 +00:00
|
|
|
let unstable = import <nixos-unstable-small> { };
|
|
|
|
|
|
|
|
in {
|
2023-01-06 18:03:46 +00:00
|
|
|
networking = {
|
|
|
|
# Host name and ID.
|
|
|
|
hostName = "servnerr-4";
|
|
|
|
hostId = "ed66dcdd";
|
|
|
|
|
|
|
|
# Use systemd-networkd for configuration. Forcibly disable legacy DHCP client.
|
|
|
|
useNetworkd = true;
|
|
|
|
useDHCP = false;
|
|
|
|
|
|
|
|
# No local firewall.
|
|
|
|
firewall.enable = false;
|
|
|
|
};
|
|
|
|
|
2023-07-22 13:28:19 +00:00
|
|
|
services.tailscale = {
|
|
|
|
enable = true;
|
|
|
|
package = unstable.tailscale;
|
|
|
|
interfaceName = "ts0";
|
|
|
|
};
|
2023-08-16 03:21:25 +00:00
|
|
|
|
|
|
|
# Tailscale readiness and DNS tweaks.
|
|
|
|
systemd.network.wait-online.ignoredInterfaces = ["ts0"];
|
|
|
|
|
2023-08-06 18:16:28 +00:00
|
|
|
systemd.services.tailscaled.after = [ "network-online.target" "systemd-resolved.service" ];
|
2023-07-22 13:28:19 +00:00
|
|
|
|
2023-01-06 18:03:46 +00:00
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
# 1GbE management LAN.
|
|
|
|
links."10-mgmt0" = {
|
|
|
|
matchConfig.MACAddress = "04:d9:f5:7e:1c:47";
|
|
|
|
linkConfig.Name = "mgmt0";
|
|
|
|
};
|
|
|
|
networks."10-mgmt0" = {
|
|
|
|
matchConfig.Name = "mgmt0";
|
|
|
|
networkConfig.DHCP = "ipv4";
|
|
|
|
dhcpV4Config.ClientIdentifier = "mac";
|
|
|
|
# Only accept DNS search on this interface.
|
|
|
|
ipv6AcceptRAConfig.UseDomains = true;
|
|
|
|
};
|
|
|
|
|
2023-08-06 18:16:28 +00:00
|
|
|
# 10GbE management LAN.
|
|
|
|
links."11-mgmt1" = {
|
2023-02-11 00:04:56 +00:00
|
|
|
matchConfig.MACAddress = "8c:dc:d4:ac:96:24";
|
2023-08-06 18:16:28 +00:00
|
|
|
linkConfig.Name = "mgmt1";
|
2023-01-06 18:03:46 +00:00
|
|
|
};
|
2023-08-06 18:16:28 +00:00
|
|
|
networks."11-mgmt1" = {
|
|
|
|
matchConfig.Name = "mgmt1";
|
2023-01-06 18:03:46 +00:00
|
|
|
networkConfig.DHCP = "ipv4";
|
2023-01-07 13:31:23 +00:00
|
|
|
dhcpV4Config.ClientIdentifier = "mac";
|
2023-02-11 00:04:56 +00:00
|
|
|
# Only accept DNS search on this interface.
|
|
|
|
ipv6AcceptRAConfig.UseDomains = true;
|
2023-01-06 18:03:46 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|