From 251b0c958fe97380fdbca35f329de2419c9bb010 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 --- .../modules/system/boot/loader/systemd-boot/systemd-boot.nix | 4 +++- 1 file changed, 3 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 84a654916441..6cab35820c88 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix @@ -24,6 +24,8 @@ let systemdBootBuilder = pkgs.substituteAll rec { name = "systemd-boot"; + dir = "bin"; + src = checkedSource; isExecutable = true; @@ -86,7 +88,7 @@ let finalSystemdBootBuilder = pkgs.writeScript "install-systemd-boot.sh" '' #!${pkgs.runtimeShell} - ${systemdBootBuilder} "$@" + ${systemdBootBuilder}/bin/systemd-boot "$@" ${cfg.extraInstallCommands} ''; in {