2023-04-15 12:58:37 -04:00
|
|
|
{ config, lib, ... }: {
|
2022-12-21 14:18:03 -07:00
|
|
|
|
2023-04-15 12:58:37 -04:00
|
|
|
config = lib.mkIf config.physical {
|
2022-12-21 14:18:03 -07:00
|
|
|
|
|
|
|
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
|
|
|
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
|
|
|
# replicates the default behaviour.
|
|
|
|
networking.useDHCP = false;
|
2023-01-31 09:07:47 -05:00
|
|
|
networking.interfaces.enp5s0.useDHCP = true;
|
|
|
|
networking.interfaces.wlp4s0.useDHCP = true;
|
2022-12-21 14:18:03 -07:00
|
|
|
|
2023-03-06 04:46:12 +00:00
|
|
|
networking.firewall.allowPing = lib.mkIf config.server true;
|
2023-04-15 10:10:10 -04:00
|
|
|
|
|
|
|
# DNS service discovery
|
2023-04-19 16:50:19 -04:00
|
|
|
services.avahi = {
|
|
|
|
enable = true;
|
|
|
|
domainName = "local";
|
|
|
|
publish = {
|
|
|
|
enable = true;
|
|
|
|
addresses = true;
|
|
|
|
domain = true;
|
|
|
|
workstation = true;
|
|
|
|
};
|
|
|
|
};
|
2023-04-15 10:10:10 -04:00
|
|
|
|
|
|
|
# Resolve local hostnames using Avahi DNS
|
|
|
|
services.avahi.nssmdns = true;
|
2023-03-06 04:46:12 +00:00
|
|
|
|
2022-12-21 14:18:03 -07:00
|
|
|
};
|
2022-04-28 22:25:05 -04:00
|
|
|
|
|
|
|
}
|