2012-04-09 20:37:54 +00:00
|
|
|
# This module allows getting memtest86 in grub menus.
|
2012-04-02 17:19:21 +00:00
|
|
|
|
|
|
|
{config, pkgs, ...}:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
let
|
|
|
|
isEnabled = config.boot.loader.grub.memtest86;
|
2012-04-09 20:37:54 +00:00
|
|
|
memtest86 = pkgs.memtest86;
|
2012-04-02 17:19:21 +00:00
|
|
|
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 {
|
2012-04-10 22:20:20 +00:00
|
|
|
extraEntries = if config.boot.loader.grub.version == 2 then
|
2012-04-02 17:19:21 +00:00
|
|
|
''
|
2012-04-09 20:37:54 +00:00
|
|
|
menuentry "${memtest86.name}" {
|
2012-04-02 17:19:21 +00:00
|
|
|
linux16 $bootRoot/memtest.bin
|
|
|
|
}
|
2012-04-10 22:20:20 +00:00
|
|
|
''
|
|
|
|
else
|
|
|
|
''
|
|
|
|
menuentry "${memtest86.name}"
|
|
|
|
linux16 $bootRoot/memtest.bin
|
2012-04-02 17:19:21 +00:00
|
|
|
'';
|
|
|
|
extraPrepareConfig =
|
|
|
|
''
|
2012-04-09 20:37:54 +00:00
|
|
|
cp ${memtest86}/memtest.bin /boot/memtest.bin;
|
2012-04-02 17:19:21 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|