added local DNS
This commit is contained in:
parent
da6c778414
commit
f277bd654d
4 changed files with 9 additions and 7 deletions
|
@ -16,6 +16,7 @@
|
||||||
address = serverIp;
|
address = serverIp;
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
defaultGateway = "192.168.1.1";
|
defaultGateway = "192.168.1.1";
|
||||||
|
dns = ["192.168.1.250" "1.1.1.1"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
address = serverIp;
|
address = serverIp;
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
defaultGateway = "192.168.1.1";
|
defaultGateway = "192.168.1.1";
|
||||||
|
dns = ["192.168.1.250" "1.1.1.1"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
address = serverIp;
|
address = serverIp;
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
defaultGateway = "192.168.1.1";
|
defaultGateway = "192.168.1.1";
|
||||||
|
dns = ["192.168.1.250" "1.1.1.1"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,6 +25,11 @@ let
|
||||||
default = null;
|
default = null;
|
||||||
example = if version == 4 then "192.168.1.1" else null;
|
example = if version == 4 then "192.168.1.1" else null;
|
||||||
};
|
};
|
||||||
|
dns = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
description = "The DNS servers to use";
|
||||||
|
default = [ "8.8.8.8" "1.1.1.1" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -103,13 +108,7 @@ in
|
||||||
cfg.ipv4.address == null || cfg.ipv4.prefixLength == null || cfg.ipv4.defaultGateway == null
|
cfg.ipv4.address == null || cfg.ipv4.prefixLength == null || cfg.ipv4.defaultGateway == null
|
||||||
);
|
);
|
||||||
defaultGateway = lib.mkIf (cfg.ipv4.defaultGateway != null) { address = cfg.ipv4.defaultGateway; };
|
defaultGateway = lib.mkIf (cfg.ipv4.defaultGateway != null) { address = cfg.ipv4.defaultGateway; };
|
||||||
nameservers =
|
nameservers = cfg.ipv4.dns;
|
||||||
lib.mkIf
|
|
||||||
(cfg.ipv4.address != null || cfg.ipv4.prefixLength != null || cfg.ipv4.defaultGateway != null)
|
|
||||||
[
|
|
||||||
"8.8.8.8"
|
|
||||||
"1.1.1.1"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue