Fix network wait-online by setting routable correctly
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
lib,
|
||||
...
|
||||
}: rec {
|
||||
mkSystemdNetwork = interface: {
|
||||
mkSystemdNetwork = interface: routable: {
|
||||
# name = "enp0s31f6"; # Network interface name?
|
||||
enable = true;
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
linkConfig = {
|
||||
# This corresponds to the [LINK] section
|
||||
# RequiredForOnline = "routable";
|
||||
RequiredForOnline = "no"; # Don't make nixos-rebuild wait for systemd-networkd-wait-online.service
|
||||
RequiredForOnline = if routable then "routable" else "no"; # Don't make nixos-rebuild wait for systemd-networkd-wait-online.service
|
||||
};
|
||||
};
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
ip,
|
||||
router,
|
||||
nameserver,
|
||||
routable,
|
||||
}: {
|
||||
# name = "enp0s31f6"; # Network interface name?
|
||||
enable = true;
|
||||
@ -75,7 +76,7 @@
|
||||
linkConfig = {
|
||||
# This corresponds to the [LINK] section
|
||||
# RequiredForOnline = "routable";
|
||||
RequiredForOnline = "no"; # Don't make nixos-rebuild wait for systemd-networkd-wait-online.service
|
||||
RequiredForOnline = if routable then "routable" else "no"; # Don't make nixos-rebuild wait for systemd-networkd-wait-online.service
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -30,7 +30,7 @@ with mylib.networking; {
|
||||
|
||||
networks = {
|
||||
# Default wildcard ethernet network for all hosts
|
||||
"50-ether" = mkSystemdNetwork "enp*";
|
||||
"50-ether" = mkSystemdNetwork "enp*" false;
|
||||
};
|
||||
|
||||
allowedTCPPorts = [
|
||||
|
@ -23,7 +23,18 @@ in {
|
||||
# Main Networks
|
||||
systemd.network = {
|
||||
enable = true;
|
||||
wait-online.anyInterface = true; # Don't wait for all networks to be configured, as e.g. wg0 will only be upon manual activation
|
||||
wait-online.timeout = 10;
|
||||
|
||||
# Don't wait for all networks to be configured, as e.g. wg0 will only be upon manual activation
|
||||
wait-online.anyInterface = true;
|
||||
|
||||
# TODO: Apparently anyInterface doesn't work?
|
||||
# wait-online.ignoredInterfaces = [
|
||||
# "wg0"
|
||||
# "wlp7s0"
|
||||
# "enp5s0"
|
||||
# ];
|
||||
|
||||
networks = cfg.networks;
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
ip = ["192.168.86.50/24"];
|
||||
router = ["192.168.86.5"];
|
||||
nameserver = ["192.168.86.26"];
|
||||
routable = true;
|
||||
};
|
||||
# "10-ether-1G" = mylib.networking.mkStaticSystemdNetwork {...};
|
||||
};
|
||||
|
Reference in New Issue
Block a user