From 875e6ad20a4f62d1b2c6c9e395f74f07b105e7a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 2 Jul 2024 08:58:41 +0200 Subject: [PATCH] nixos/systemd-boot: Fix regression in builder script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid running Python scripts in the root of the package, as this triggers `os.listdir` on the Nix store directory during import. This operation can be time-consuming on large store directories (see issue #283795 for more details). The issue was initially fixed in #284153 but was reverted in #306339. Co-authored-by: Sönke Hahn (cherry picked from commit 251b0c958fe97380fdbca35f329de2419c9bb010) --- .../system/boot/loader/systemd-boot/systemd-boot.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 f66501431df201a..5dfea5b615a30de 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix @@ -22,6 +22,10 @@ let ''; systemdBootBuilder = pkgs.substituteAll rec { + name = "systemd-boot"; + + dir = "bin"; + src = checkedSource; isExecutable = true; @@ -82,7 +86,7 @@ let finalSystemdBootBuilder = pkgs.writeScript "install-systemd-boot.sh" '' #!${pkgs.runtimeShell} - ${systemdBootBuilder} "$@" + ${systemdBootBuilder}/bin/systemd-boot "$@" ${cfg.extraInstallCommands} ''; in {