nixpkgs-suyu/nixos/modules/system/boot/loader/grub/memtest.nix
Eelco Dolstra 4b1a9dd00b Remove uses of mkFixStrictness
mkFixStrictness is no longer needed, woohoo!
2013-10-28 22:45:55 +01:00

39 lines
791 B
Nix

# 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 =
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";
};
}