diff --git a/nixos/modules/system/boot/loader/limine/limine-install.py b/nixos/modules/system/boot/loader/limine/limine-install.py index 746cb693409c..21cf817509fc 100644 --- a/nixos/modules/system/boot/loader/limine/limine-install.py +++ b/nixos/modules/system/boot/loader/limine/limine-install.py @@ -145,8 +145,10 @@ def config_entry(levels: int, bootspec: BootSpec, label: str, time: str) -> str: entry += f'module_path: ' + get_kernel_uri(bootspec.initrd) + '\n' if bootspec.initrdSecrets: - initrd_secrets_path = str(limine_install_dir) + '/kernels/' + os.path.basename(bootspec.toplevel) + '-secrets' - os.makedirs(initrd_secrets_path) + base_path = str(limine_install_dir) + '/kernels/' + initrd_secrets_path = base_path + os.path.basename(bootspec.toplevel) + '-secrets' + if not os.path.exists(base_path): + os.makedirs(base_path) old_umask = os.umask(0o137) initrd_secrets_path_temp = tempfile.mktemp(os.path.basename(bootspec.toplevel) + '-secrets')