Skip to content

Commit af5a074

Browse files
committed
set default network config
1 parent e1a01bf commit af5a074

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

os/flake.nix

Lines changed: 6 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

0 commit comments

Comments
 (0)