From 820d20f8b90c6b1cedfa5980a24d012e4769246f Mon Sep 17 00:00:00 2001 From: r-vdp Date: Mon, 4 May 2026 12:17:51 +0200 Subject: [PATCH] nixos/systemd-boot-builder: cache boot_path() It calls Path.resolve() and is invoked several times per generation for the same store paths. --- .../system/boot/loader/systemd-boot/systemd-boot-builder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py index 1d2feb0d3dc9..2a0693f4d237 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py @@ -3,6 +3,7 @@ import argparse import ctypes import datetime import errno +import functools import hashlib import os import re @@ -330,6 +331,7 @@ def bootspec_from_json(bootspec_json: dict[str, Any]) -> BootSpec: ) +@functools.lru_cache(maxsize=None) def boot_path(file: Path) -> Path: store_file_path = file.resolve() suffix = store_file_path.name