{ eth-interface ? "eth0", static-ip ? false, # false, or IPv4 address default-gateway ? "192.168.1.1", }: { networking = if static-ip != false then { defaultGateway = { address = default-gateway; interface = eth-interface; }; useDHCP = false; interfaces.${eth-interface}.ipv4.addresses = [ { address = static-ip; prefixLength = 24; } ]; } else { }; }