nixos-generate-config: Don't emit networking.hostId
Systemd already generates /etc/machine-id. So there is no need to generate another unique host identifer.
This commit is contained in:
parent
0d3a229baa
commit
bed675f400
@ -476,14 +476,6 @@ EOF
|
|||||||
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, <<EOF);
|
write_file($fn, <<EOF);
|
||||||
# Edit this configuration file to define what should be installed on
|
# Edit this configuration file to define what should be installed on
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
@ -499,7 +491,6 @@ EOF
|
|||||||
|
|
||||||
$bootLoaderConfig
|
$bootLoaderConfig
|
||||||
# networking.hostName = "nixos"; # Define your hostname.
|
# networking.hostName = "nixos"; # Define your hostname.
|
||||||
networking.hostId = "$hostIdHex";
|
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
# Select internationalisation properties.
|
# Select internationalisation properties.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user