{ lib, ... }: let vpnHosts = [ { ip = "10.0.1.11"; hosts = [ "giggles.vpn" ]; } { ip = "10.0.1.12"; hosts = [ "cox.vpn" ]; } { ip = "10.0.1.13"; hosts = [ "companion.vpn" ]; } ]; mkVpnHosts = e: {${e.ip} = e.hosts;}; in { networking.hosts = lib.attrsets.mergeAttrsList (builtins.map mkVpnHosts vpnHosts) ; }