assertions
This commit is contained in:
@@ -57,6 +57,33 @@ in
|
||||
];
|
||||
|
||||
config = {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.hostName != "";
|
||||
message = "mjallen.network.hostName must be set to a non-empty string.";
|
||||
}
|
||||
{
|
||||
assertion = cfg.ipv4.method == "auto" || cfg.ipv4.method == "manual";
|
||||
message = "mjallen.network.ipv4.method must be either \"auto\" or \"manual\" (got \"${cfg.ipv4.method}\").";
|
||||
}
|
||||
{
|
||||
assertion = cfg.ipv4.method != "manual" || cfg.ipv4.interface != "";
|
||||
message = "mjallen.network.ipv4.interface must be set when ipv4.method is \"manual\".";
|
||||
}
|
||||
{
|
||||
assertion = cfg.ipv4.method != "manual" || cfg.ipv4.address != "";
|
||||
message = "mjallen.network.ipv4.address must be set when ipv4.method is \"manual\".";
|
||||
}
|
||||
{
|
||||
assertion = cfg.ipv4.method != "manual" || cfg.ipv4.gateway != "";
|
||||
message = "mjallen.network.ipv4.gateway must be set when ipv4.method is \"manual\".";
|
||||
}
|
||||
{
|
||||
assertion = cfg.nat.enable -> cfg.nat.externalInterface != "";
|
||||
message = "mjallen.network.nat.externalInterface must be set when NAT is enabled.";
|
||||
}
|
||||
];
|
||||
|
||||
systemd = {
|
||||
services = {
|
||||
NetworkManager-wait-online.enable = false;
|
||||
|
||||
Reference in New Issue
Block a user