nixpkgs/modules/system/boot/loader/grub/memtest.nix
Peter Simons 91bead9c18 modules/system/boot/loader/grub/memtest.nix: use 'memtest86plus' instead of 'memtest86'
The 'memtest86' package didn't work on any of my machines. 'memtest86plus', on
the other hand, seems to work just fine. Does anyone know why we keep the
seemingly older version around still?
2013-01-09 22:44:50 +01:00

39 lines
839 B
Nix

# This module allows getting memtest86 in grub menus.
{config, pkgs, ...}:
with pkgs.lib;
let
isEnabled = config.boot.loader.grub.memtest86;
memtest86 = pkgs.memtest86plus;
in
{
options = {
boot.loader.grub.memtest86 = mkOption {
default = false;
type = types.bool;
description = ''
Add a menu entry in grub for memtest86+
'';
};
};
config.boot.loader.grub = mkIf isEnabled {
extraEntries = if config.boot.loader.grub.version == 2 then
''
menuentry "${memtest86.name}" {
linux16 @bootRoot@/memtest.bin
}
''
else
''
menuentry "${memtest86.name}"
linux16 @bootRoot@/memtest.bin
'';
extraPrepareConfig =
''
${pkgs.coreutils}/bin/cp ${memtest86}/memtest.bin /boot/memtest.bin;
'';
};
}