From 48a6b898ae80cc62dc15a481fb49f947dd2eb9f6 Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Wed, 26 Nov 2025 22:16:28 -0800 Subject: [PATCH 1/4] nixos/grub: use new combined memtest86plus binary memtest86plus puts the path to the binary at a passthru attr after memtest86plus 8 there's a single combined EFI+legacy file --- nixos/modules/system/boot/loader/grub/grub.nix | 2 +- nixos/modules/system/boot/loader/grub/memtest.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; }; } From fb05ac176a1f0548f2ce5b8a781e664aa82079bf Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Wed, 26 Nov 2025 22:16:28 -0800 Subject: [PATCH 2/4] nixos/installer/cd-dvd/iso-image: use new combined memtest86plus binary memtest86plus puts the path to the binary at a passthru attr after memtest86plus 8 there's a single combined EFI+legacy file --- nixos/modules/installer/cd-dvd/iso-image.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"; } ] From e95bd0bf1c57f935c8eab658e3affbdde77a2ffa Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Wed, 26 Nov 2025 22:16:28 -0800 Subject: [PATCH 3/4] nixos/systemd-boot: use new combined memtest86plus binary memtest86plus puts the path to the binary at a passthru attr after memtest86plus 8 there's a single combined EFI+legacy file --- .../modules/system/boot/loader/systemd-boot/systemd-boot.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}"; From b4b8da3152652f1ad79736ea7684a483d7a293ea Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Wed, 26 Nov 2025 22:23:14 -0800 Subject: [PATCH 4/4] memtest86plus: add nixosTests.systemd-boot.memtest86 to tests --- pkgs/by-name/me/memtest86plus/package.nix | 3 +++ 1 file changed, 3 insertions(+) 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";