@@ -16,11 +16,6 @@ let
1616
1717 qemu = config.system.build.qemu or pkgs.qemu_test;
1818
19− vmName =
20− if config.networking.hostName == ""
21− then "noname"
22− else config.networking.hostName;
23−
2419 cfg = config.virtualisation;
2520
2621 consoles = lib.concatMapStringsSep " " (c: "console=${c}") cfg.qemu.consoles;
@@ -156,7 +151,7 @@ let
156151
157152 # Start QEMU.
158153 exec ${qemuBinary qemu} \
159− -name ${vmName} \
154+ -name ${config.system.name} \
160155 -m ${toString config.virtualisation.memorySize} \
161156 -smp ${toString config.virtualisation.cores} \
162157 -device virtio-rng-pci \
@@ -294,7 +289,7 @@ in
294289
295290 virtualisation.diskImage =
296291 mkOption {
297− default = "./${vmName}.qcow2";
292+ default = "./${config.system.name}.qcow2";
298293 description =
299294 ''
300295 Path to the disk image containing the root filesystem.
@@ -712,7 +707,7 @@ in
712707 ''
713708 mkdir -p $out/bin
714709 ln -s ${config.system.build.toplevel} $out/system
715− ln -s ${pkgs.writeScript "run-nixos-vm" startVM} $out/bin/run-${vmName}-vm
710+ ln -s ${pkgs.writeScript "run-nixos-vm" startVM} $out/bin/run-${config.system.name}-vm
716711 '';
717712
718713 # When building a regular system configuration, override whatever