Skip to content

Commit 78461bd

Browse files
committed
set default network config
1 parent e1a01bf commit 78461bd

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

os/flake.nix

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,15 @@
220220
if (builtins.pathExists ./network-config) then
221221
builtins.fromJSON (builtins.readFile ./network-config)
222222
else
223-
{ };
223+
{
224+
address = [ ];
225+
route = [ ];
226+
};
224227
network-config = builtins.map (address: {
225228
name = address.address;
226229
value = {
227-
ip = builtins.map (ip: { address = "${ip.local}/${ip.prefixlen}"; }) (
228-
builtins.filter (ip: ip.scope == "global" && !ip.dynamic) address.addr_info
230+
ip = builtins.map (ip: { address = "${ip.local}/${builtins.toString ip.prefixlen}"; }) (
231+
builtins.filter (ip: ip.scope == "global" && !(ip.dynamic or false)) address.addr_info
229232
);
230233
route =
231234
builtins.map
@@ -248,6 +251,12 @@
248251
name = "00-${interface.name}";
249252
value = {
250253
matchConfig.MACAddress = interface.name;
254+
networkConfig = {
255+
DHCP = "yes";
256+
LLDP = "yes";
257+
IPv6AcceptRA = "yes";
258+
MulticastDNS = "yes";
259+
};
251260
address = builtins.map (ip: ip.address) interface.value.ip;
252261
routes = builtins.map (route: {
253262
Destination = route.destination;

0 commit comments

Comments
 (0)