blob: a0726c01e204343bb7df51b3b97d18fe52a372d5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# This module adds Memtest86+ to the GRUB boot menu.
{ config, pkgs, ... }:
with pkgs.lib;
let
memtest86 = pkgs.memtest86plus;
in
{
options = {
boot.loader.grub.memtest86 = mkOption {
default = false;
type = types.bool;
description = ''
Make Memtest86+, a memory testing program, available from the
GRUB boot menu.
'';
};
};
config = mkIf config.boot.loader.grub.memtest86 {
boot.loader.grub.extraEntries = mkFixStrictness (
if config.boot.loader.grub.version == 2 then
''
menuentry "Memtest86+" {
linux16 @bootRoot@/memtest.bin
}
''
else
throw "Memtest86+ is not supported with GRUB 1.");
boot.loader.grub.extraFiles."memtest.bin" = "${memtest86}/memtest.bin";
};
}
|