networking.dhcpcd.setHostname
NixOS option
Whether to set the machine hostname based on the information received from the DHCP server. The hostname will be changed only if the current one is the empty string, localhost or nixos. Polkit (security.polkit.enable) is also required.
type: booleanDefault
declared in: nixos/modules/services/networking/dhcpcd.nixView source on NixOS/nixpkgs →true