Tobias dpausp 2d1a82bcf0 Fix network config for recent NixOS releases
The old config style doesn't build anymore on the current
release NixOS 20.09. It stopped working some releases ago.
2021-01-25 00:19:34 +00:00

16 lines
395 B
Plaintext

{ config, pkgs, ... }:
{
networking.interfaces = {
<% networks.select {|n| n[:device]}.each do |network| %>
<%= network[:device] %>.ipv4.addresses = [{
<% if network[:type] == :static %>
address = "<%= network[:ip] %>";
<% end %>
<% if network[:prefix_length] %>
prefixLength = <%= network[:prefix_length] %>;
<% end %>
}];
<% end %>
};
}