Under Nixos 26.05 every time I use nixos-rebuild switch it fails systematically since a few months with the following error:
Checking switch inhibitors... done
updating systemd-boot from 260.2 to 260.5
Skipping "/boot/EFI/systemd/systemd-bootx64.efi", same boot loader version in place already.
Skipping "/boot/EFI/BOOT/BOOTX64.EFI", same boot loader version in place already.
Traceback (most recent call last):
File "/nix/store/3vjd2znn29jvh6d58s4ny0v3pmfhppph-systemd-boot/bin/systemd-boot", line 452, in
main()
~~~~^^
File "/nix/store/3vjd2znn29jvh6d58s4ny0v3pmfhppph-systemd-boot/bin/systemd-boot", line 435, in main
install_bootloader(args)
~~~~~~~~~~~~~~~~~~^^^^^^
File "/nix/store/3vjd2znn29jvh6d58s4ny0v3pmfhppph-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/3vjd2znn29jvh6d58s4ny0v3pmfhppph-systemd-boot/bin/systemd-boot", line 58, in run
return subprocess.run(cmd, check=True, text=True, stdout=stdout)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/kp6p38x6zb21n7gdlnp9nsm2aagq7sg2-python3-3.13.17/lib/python3.13/subprocess.py", line 578, in run
raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/nix/store/y3fqx697649kqv1a9c0z1jsk4wy2zlqa-systemd-260.5/bin/bootctl', '--esp-path=/boot', 'update']' returned non-zero exit status 1.
Failed to install bootloader
Command 'sudo env -i PATH=/nix/store/kp6p38x6zb21n7gdlnp9nsm2aagq7sg2-python3-3.13.17/bin:/nix/store/937nh4iw4w72zxvhdiw3hdxjs788mgib-nixos-rebuild-ng-26.05/bin:/nix/store/yhr7fyambqxzwvr8z3scq302vdc2dyzp-nix-2.34.9/bin:/nix/store/jy00n3jp5xj8s40n1fbldmkcr5n7avxc-python3-3.13.15/bin:/nix/store/bfmy3lkvwjd00pspa874jn4s7sbizv2d-nixos-rebuild-ng-26.05/bin:/nix/store/5np0yidzrnyjbb243hvgqpgpss865p0n-nix-2.34.9/bin:/home/bless/.local/bin:/run/wrappers/bin:/home/bless/.nix-profile/bin:/nix/profile/bin:/home/bless/.local/state/nix/profile/bin:/etc/profiles/per-user/bless/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive NIXOS_INSTALL_BOOTLOADER=0 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/cm2275y4yfix164sk28dvyk9dzc0rp9x-nixos-system-i72p14s5grb-26.05.13297.fa1373130d5a/bin/switch-to-configuration switch' returned non-zero exit status 1.
just moving /boot/EFI/BOOT/BOOTX64.EFI and boot/EFI/systemd/systemd-bootx64.efi out of the way is a work-around but really annoying.