diff --git a/modules/installer/cd-dvd/installation-cd-base.nix b/modules/installer/cd-dvd/installation-cd-base.nix index a3e83e3074f7..f595a6307f07 100644 --- a/modules/installer/cd-dvd/installation-cd-base.nix +++ b/modules/installer/cd-dvd/installation-cd-base.nix @@ -30,7 +30,8 @@ in { require = - [ ./iso-image.nix + [ ./memtest.nix + ./iso-image.nix # Profiles of this basic installation CD. ../../profiles/all-hardware.nix @@ -66,8 +67,6 @@ in echo 1 > /proc/sys/vm/overcommit_memory ''; - boot.loader.grub.memtest86 = true; - # To speed up installation a little bit, include the complete stdenv # in the Nix store on the CD. isoImage.storeContents = [ pkgs.stdenv pkgs.klibc pkgs.klibcShrunk ]; diff --git a/modules/installer/cd-dvd/memtest.nix b/modules/installer/cd-dvd/memtest.nix new file mode 100644 index 000000000000..52b3d8af7c1d --- /dev/null +++ b/modules/installer/cd-dvd/memtest.nix @@ -0,0 +1,24 @@ +# This module adds Memtest86 to the Grub boot menu on the CD. + +{config, pkgs, ...}: + +let + + memtestPath = "/boot/memtest.bin"; + +in + +{ + boot.loader.grub.extraEntries = + '' + menuentry "Memtest86" { + linux16 ${memtestPath} + } + ''; + + isoImage.contents = + [ { source = pkgs.memtest86 + "/memtest.bin"; + target = memtestPath; + } + ]; +}