{ lib, config, pkgs, ... }: with lib; let cfg = config.local; in { options.local = with lib.types; { hostname = mkOption { type = str; }; dhcpInterface = mkOption { type = nullOr str; default = null; }; }; config = { networking = { hostName = cfg.hostname; useDHCP = false; useNetworkd = true; interfaces = mkIf (cfg.dhcpInterface != null) { "${cfg.dhcpInterface}".useDHCP = true; }; wireguard.enable = true; }; environment.systemPackages = [ pkgs.dhcpcd ]; }; }