36 lines
793 B
Nix
36 lines
793 B
Nix
# Network host configuration with static IP and Avahi discovery
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
services.avahi = {
|
|
enable = true;
|
|
nssmdns4 = true;
|
|
openFirewall = true;
|
|
publish = {
|
|
enable = true;
|
|
userServices = true;
|
|
addresses = true;
|
|
};
|
|
};
|
|
|
|
networking = {
|
|
nameservers = config.homelab.networking.nameservers;
|
|
enableIPv6 = false;
|
|
|
|
# Avahi port
|
|
firewall.allowedUDPPorts = [ 5353 ];
|
|
|
|
hostName = "homelab";
|
|
interfaces.${config.homelab.networking.interface} = {
|
|
ipv4.addresses = [{
|
|
address = config.homelab.networking.staticIP;
|
|
prefixLength = 24;
|
|
}];
|
|
};
|
|
|
|
defaultGateway = {
|
|
address = config.homelab.networking.gateway;
|
|
interface = config.homelab.networking.interface;
|
|
};
|
|
};
|
|
}
|