diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index 60ba783b0466..93936e85ce2f 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -1014,7 +1014,7 @@ in ] ++ lib.optionals (config.boot.loader.grub.memtest86.enable && config.isoImage.makeBiosBootable) [ { - source = "${pkgs.memtest86plus}/memtest.bin"; + source = pkgs.memtest86plus.efi; target = "/boot/memtest.bin"; } ] diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index c18d5431bd8a..042fd63cd254 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -472,7 +472,7 @@ in type = types.attrsOf types.path; default = { }; example = literalExpression '' - { "memtest.bin" = "''${pkgs.memtest86plus}/memtest.bin"; } + { "memtest.bin" = pkgs.memtest86plus.efi; } ''; description = '' A set of files to be copied to {file}`/boot`. diff --git a/nixos/modules/system/boot/loader/grub/memtest.nix b/nixos/modules/system/boot/loader/grub/memtest.nix index b762a7b6ce46..fb3db9ee31cb 100644 --- a/nixos/modules/system/boot/loader/grub/memtest.nix +++ b/nixos/modules/system/boot/loader/grub/memtest.nix @@ -69,6 +69,6 @@ in linux @bootRoot@/memtest.bin ${toString cfg.params} } ''; - boot.loader.grub.extraFiles."memtest.bin" = "${memtest86}/memtest.bin"; + boot.loader.grub.extraFiles."memtest.bin" = memtest86.efi; }; } diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix index 487c9995e0c8..c4275d0410c3 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix @@ -391,7 +391,7 @@ in type = types.attrsOf types.path; default = { }; example = literalExpression '' - { "efi/memtest86/memtest.efi" = "''${pkgs.memtest86plus}/memtest.efi"; } + { "efi/memtest86/memtest.efi" = pkgs.memtest86plus.efi; } ''; description = '' A set of files to be copied to {file}`$BOOT`. @@ -578,7 +578,7 @@ in boot.loader.systemd-boot.extraFiles = mkMerge [ (mkIf cfg.memtest86.enable { - "efi/memtest86/memtest.efi" = "${pkgs.memtest86plus.efi}"; + "efi/memtest86/memtest.efi" = pkgs.memtest86plus.efi; }) (mkIf cfg.netbootxyz.enable { "efi/netbootxyz/netboot.xyz.efi" = "${pkgs.netbootxyz-efi}"; diff --git a/pkgs/by-name/me/memtest86plus/package.nix b/pkgs/by-name/me/memtest86plus/package.nix index 0822e4605e21..cbdeb15fd66b 100644 --- a/pkgs/by-name/me/memtest86plus/package.nix +++ b/pkgs/by-name/me/memtest86plus/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + nixosTests, }: stdenv.mkDerivation (finalAttrs: { @@ -30,6 +31,8 @@ stdenv.mkDerivation (finalAttrs: { install -Dm0444 mt86plus $out/mt86plus.efi ''; + passthru.tests.systemd-boot-memtest = nixosTests.systemd-boot.memtest86; + meta = { homepage = "https://www.memtest.org/"; description = "Tool to detect memory errors";