Bootloader failed to install with systemd-boot

[user@nixos:~]$ sudo nixos-rebuild boot
[sudo] password for user: 
building the system configuration...
Not checking switch inhibitors (action = boot)
updating systemd-boot from 258.1-1-arch to 260.2
Skipping "/boot/EFI/systemd/systemd-bootx64.efi", newer boot loader version in place already.
Skipping "/boot/EFI/BOOT/BOOTX64.EFI", newer boot loader version in place already.
Skipping "/boot/EFI/BOOT/mmx64.efi", it's owned by another boot loader (no version info found).
Skipping "/boot/EFI/BOOT/fbx64.efi", it's owned by another boot loader (no version info found).
Traceback (most recent call last):
  File "/nix/store/x4d8g4dx5chblzfwx8s506k691jbffrz-systemd-boot/bin/systemd-boot", line 452, in <module>
    main()
    ~~~~^^
  File "/nix/store/x4d8g4dx5chblzfwx8s506k691jbffrz-systemd-boot/bin/systemd-boot", line 435, in main
    install_bootloader(args)
    ~~~~~~~~~~~~~~~~~~^^^^^^
  File "/nix/store/x4d8g4dx5chblzfwx8s506k691jbffrz-systemd-boot/bin/systemd-boot", line 370, in install_bootloader
    run(
    ~~~^
        [f"{SYSTEMD}/bin/bootctl", f"--esp-path={EFI_SYS_MOUNT_POINT}"]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        + bootctl_flags
        ^^^^^^^^^^^^^^^
        + ["update"]
        ^^^^^^^^^^^^
    )
    ^
  File "/nix/store/x4d8g4dx5chblzfwx8s506k691jbffrz-systemd-boot/bin/systemd-boot", line 58, in run
    return subprocess.run(cmd, check=True, text=True, stdout=stdout)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/kxdkzc079hlg9ifg4lhjvyi2w7qwpshx-python3-3.13.14/lib/python3.13/subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/nix/store/krsvx5x37w4h082i25iqwls10bhcdxl7-systemd-260.2/bin/bootctl', '--esp-path=/boot', 'update']' returned non-zero exit status 1.
Failed to install bootloader
Command 'systemd-run -E LOCALE_ARCHIVE -E NIXOS_INSTALL_BOOTLOADER -E NIXOS_NO_CHECK --collect --no-ask-password --pipe --quiet --service-type=exec --unit=nixos-rebuild-switch-to-configuration /nix/store/ppb1xr6kk5zqhysxz88rr39dfmw7b0ml-nixos-system-nixos-26.05.7675.02e08985a27c/bin/switch-to-configuration boot' returned non-zero exit status 1.

I have two almost similar workstations with multiboot using systemd-boot. Just one is having this trouble. The standard checks do not indicate anything to be wrong.

Any ideas how to tackle it?

It may be a bug as
/nix/store/krsvx5x37w4h082i25iqwls10bhcdxl7-systemd-260.2/bin/bootctl --esp-path=/boot update
does not return an error as reported here

...
  File "/nix/store/kxdkzc079hlg9ifg4lhjvyi2w7qwpshx-python3-3.13.14/lib/python3.13/subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/nix/store/krsvx5x37w4h082i25iqwls10bhcdxl7-systemd-260.2/bin/bootctl', '--esp-path=/boot', 'update']' returned non-zero exit status 1.

I am now considering a re-install of 26.05.

I’ve run into the same issue on 26.05

I did some research, seems like this is a false positive bug; there actually is no issue with the boot loader so it should be safe to ignore the error, so following this person’s advice, setting boot.loader.systemd-boot.graceful = true; in my configuration.nix fixed my issues.

Links related to the issue if you’re curious:

1 Like