···84848585# This is a NixOS installation if it has /etc/NIXOS or a proper
8686# /etc/os-release.
8787-if (!-f "/etc/NIXOS" && (read_file("/etc/os-release", err_mode => "quiet") // "") !~ /^ID="?nixos"?/msx) {
8787+if (!-f "/etc/NIXOS" && (read_file("/etc/os-release", err_mode => "quiet") // "") !~ /^ID="?@distroId@"?/msx) {
8888 die("This is not a NixOS installation!\n");
8989}
9090
···434434 options = {
435435436436 networking.hostName = mkOption {
437437- default = "nixos";
437437+ default = config.system.nixos.distroId;
438438+ defaultText = literalExpression "config.system.nixos.distroId";
438439 # Only allow hostnames without the domain name part (i.e. no FQDNs, see
439440 # e.g. "man 5 hostname") and require valid DNS labels (recommended
440441 # syntax). Note: We also allow underscores for compatibility/legacy