diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index e8f100d6498..9abc1b4cc1b 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -476,6 +476,14 @@ EOF EOF } + # Generate a random 32-bit value to use as the host id + open my $rnd, "<", "/dev/urandom" or die $!; + read $rnd, $hostIdBin, 4; + close $rnd; + + # Convert the 32-bit value to a hex string + my $hostIdHex = unpack("H*", $hostIdBin); + write_file($fn, <