Skip to content

Commit

Permalink
nixos/systemd-boot: Fix regression in builder script
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit 251b0c9)
  • Loading branch information
jfroche committed Sep 16, 2024
1 parent 6fa7cce commit 875e6ad
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ let
'';

systemdBootBuilder = pkgs.substituteAll rec {
name = "systemd-boot";

dir = "bin";

src = checkedSource;

isExecutable = true;
Expand Down Expand Up @@ -82,7 +86,7 @@ let

finalSystemdBootBuilder = pkgs.writeScript "install-systemd-boot.sh" ''
#!${pkgs.runtimeShell}
${systemdBootBuilder} "$@"
${systemdBootBuilder}/bin/systemd-boot "$@"
${cfg.extraInstallCommands}
'';
in {
Expand Down

0 comments on commit 875e6ad

Please sign in to comment.