Browse Source

nixos: Allow empty hostnames again

This fixes a regression from 993baa587c which requires
networking.hostName to be a valid DNS label [0].
Unfortunately we missed the fact that the hostnames may also be empty,
if the user wants to obtain it from a DHCP server. This is even required
by a few modules/images (e.g. Amazon EC2, Azure, and Google Compute).

[0]: https://github.com/NixOS/nixpkgs/pull/76542#issuecomment-638138666
wip-nanopi-m4v2
Michael Weiss 6 years ago
parent
commit
a6afdbb70b
No known key found for this signature in database GPG Key ID: 5BE487C4D4771D83
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      nixos/modules/tasks/network-interfaces.nix

+ 1
- 1
nixos/modules/tasks/network-interfaces.nix View File

@@ -381,7 +381,7 @@ in
# syntax). Note: We also allow underscores for compatibility/legacy
# reasons (as undocumented feature):
type = types.strMatching
"^[[:alpha:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$";
"^$|^[[:alpha:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$";
description = ''
The name of the machine. Leave it empty if you want to obtain it from a
DHCP server (if using DHCP). The hostname must be a valid DNS label (see


Loading…
Cancel
Save