2023-09-14 14:57:38 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
{
|
|
|
|
options.clan.networking = {
|
|
|
|
deploymentAddress = lib.mkOption {
|
|
|
|
description = ''
|
|
|
|
The target SSH node for deployment.
|
|
|
|
|
|
|
|
By default, the node's attribute name will be used.
|
|
|
|
If set to null, only local deployment will be supported.
|
2023-09-21 13:21:19 +00:00
|
|
|
|
|
|
|
format: user@host:port&SSH_OPTION=SSH_VALUE
|
|
|
|
examples:
|
|
|
|
- machine.example.com
|
|
|
|
- user@machine2.example.com
|
|
|
|
- root@example.com:2222&IdentityFile=/path/to/private/key
|
2023-09-14 14:57:38 +00:00
|
|
|
'';
|
|
|
|
type = lib.types.nullOr lib.types.str;
|
|
|
|
default = "root@${config.networking.hostName}";
|
|
|
|
};
|
|
|
|
};
|
2023-11-15 05:54:29 +00:00
|
|
|
config = {
|
|
|
|
# conflicts with systemd-resolved
|
|
|
|
networking.useHostResolvConf = false;
|
|
|
|
|
2023-11-15 10:04:03 +00:00
|
|
|
# Allow PMTU / DHCP
|
|
|
|
networking.firewall.allowPing = true;
|
|
|
|
|
2023-11-15 05:54:29 +00:00
|
|
|
# The notion of "online" is a broken concept
|
|
|
|
# https://github.com/systemd/systemd/blob/e1b45a756f71deac8c1aa9a008bd0dab47f64777/NEWS#L13
|
|
|
|
systemd.services.NetworkManager-wait-online.enable = false;
|
|
|
|
systemd.network.wait-online.enable = false;
|
|
|
|
|
2023-11-15 06:44:30 +00:00
|
|
|
# Provide a default network configuration but don't compete with network-manager or dhcpcd
|
|
|
|
systemd.network.networks."50-uplink" = lib.mkIf (!(config.networking.networkmanager.enable || config.networking.dhcpcd.enable)) {
|
|
|
|
matchConfig.Type = "ether";
|
|
|
|
networkConfig = {
|
|
|
|
DHCP = "yes";
|
|
|
|
LLDP = "yes";
|
|
|
|
LLMNR = "yes";
|
|
|
|
MulticastDNS = "yes";
|
|
|
|
IPv6AcceptRA = "yes";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-15 05:54:29 +00:00
|
|
|
# Use networkd instead of the pile of shell scripts
|
|
|
|
networking.useNetworkd = lib.mkDefault true;
|
|
|
|
networking.useDHCP = lib.mkDefault false;
|
|
|
|
};
|
2023-09-14 14:57:38 +00:00
|
|
|
}
|