Cannot install nixos

This is my first post over here. I got my usb flashed with the iso. I followed the steps to proceed with the installation. It worked on my main pc and now I want to install NixOs in a laptop. Different hardware. It keeps giving me errors when I try to install the OS. I tried with linux LTS and Linux (the non-lts option). I don’t know if it matters. Previously I installe Arch on this computer so I think everything should work.

https://termbin.com/c4gt

I believe that is the output of my failed installation.

I need help debugging the problem.
From what I could read. I believe the issue relies on the installation of the bootloader

2025-10-06 - 14:34:06 [6]: DEBUG (Qt): QML Component (default slideshow) Next slide
2025-10-06 - 14:34:08 [6]: [PYTHON JOB]: "nixos-install: /nix/store/mcrq9d74pq62q7njvqpjxvxh2b94ggpw-nixos-system-nixos-25.05.810767.3bcc93c5f7a4" 
2025-10-06 - 14:34:11 [6]: [PYTHON JOB]: "nixos-install: installing the boot loader..." 
2025-10-06 - 14:34:14 [6]: [PYTHON JOB]: "nixos-install: setting up /etc..." 
2025-10-06 - 14:34:18 [6]: [PYTHON JOB]: "nixos-install: Created \"/boot/EFI\"." 
2025-10-06 - 14:34:18 [6]: [PYTHON JOB]: "nixos-install: Created \"/boot/EFI/systemd\"." 
2025-10-06 - 14:34:18 [6]: [PYTHON JOB]: "nixos-install: Created \"/boot/EFI/BOOT\"." 
2025-10-06 - 14:34:18 [6]: [PYTHON JOB]: "nixos-install: Created \"/boot/loader\"." 
2025-10-06 - 14:34:18 [6]: [PYTHON JOB]: "nixos-install: Created \"/boot/loader/keys\"." 
2025-10-06 - 14:34:18 [6]: [PYTHON JOB]: "nixos-install: Created \"/boot/loader/entries\"." 
2025-10-06 - 14:34:18 [6]: [PYTHON JOB]: "nixos-install: Created \"/boot/EFI/Linux\"." 
2025-10-06 - 14:34:18 [6]: [PYTHON JOB]: "nixos-install: Copied \"/nix/store/d84f8nm2na5cr53m4jk0qk2mj7lgr9fx-systemd-257.9/lib/systemd/boot/efi/systemd-bootx64.efi\" to \"/boot/EFI/systemd/systemd-bootx64.efi\"." 
2025-10-06 - 14:34:19 [6]: [PYTHON JOB]: "nixos-install: Copied \"/nix/store/d84f8nm2na5cr53m4jk0qk2mj7lgr9fx-systemd-257.9/lib/systemd/boot/efi/systemd-bootx64.efi\" to \"/boot/EFI/BOOT/BOOTX64.EFI\"." 
2025-10-06 - 14:34:19 [6]: [PYTHON JOB]: "nixos-install: Random seed file /boot/loader/random-seed successfully written (32 bytes)." 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: Failed to write 'LoaderSystemToken' EFI variable: Input/output error" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: Traceback (most recent call last):" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: File \"/nix/store/r69irg1dc8kf37l19gxvyv33wwhjffri-systemd-boot/bin/systemd-boot\", line 431, in <module>" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: main()" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: File \"/nix/store/r69irg1dc8kf37l19gxvyv33wwhjffri-systemd-boot/bin/systemd-boot\", line 414, in main" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: install_bootloader(args)" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: File \"/nix/store/r69irg1dc8kf37l19gxvyv33wwhjffri-systemd-boot/bin/systemd-boot\", line 307, in install_bootloader" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: run(" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: File \"/nix/store/r69irg1dc8kf37l19gxvyv33wwhjffri-systemd-boot/bin/systemd-boot\", line 58, in run" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: return subprocess.run(cmd, check=True, text=True, stdout=stdout)" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: File \"/nix/store/vxl8pzgkkw8vdb4agzwm58imrfclmfrx-python3-3.12.11/lib/python3.12/subprocess.py\", line 571, in run" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: raise CalledProcessError(retcode, process.args," 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: subprocess.CalledProcessError: Command '['/nix/store/d84f8nm2na5cr53m4jk0qk2mj7lgr9fx-systemd-257.9/bin/bootctl', '--esp-path=/boot', 'install']' returned non-zero exit status 1." 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: Failed to install bootloader" 
2025-10-06 - 14:34:25 [6]: [PYTHON JOB]: "nixos-install: " 
2025-10-06 - 14:34:26 [6]: DEBUG (Qt): QML Component (default slideshow) Next slide
2025-10-06 - 14:34:27 [6]: virtual void Calamares::JobThread::run()
2025-10-06 - 14:34:27 [6]:     Skipping non-emergency job "Set password for user maximo" 
2025-10-06 - 14:34:27 [6]:     ..  Skipping non-emergency job "Set password for user root" 
2025-10-06 - 14:34:27 [6]:     ..  Skipping non-emergency job "Unmounting file systems…" 
2025-10-06 - 14:34:28 [1]: void Calamares::ViewManager::onInstallationFailed(const QString&, const QString&)
2025-10-06 - 14:34:28 [1]:     ERROR: Installation failed: "nixos-install failed" 
2025-10-06 - 14:34:28 [6]:     .. - message: "nixos-install failed" 
2025-10-06 - 14:34:28 [6]:     .. - details: copying channel...
building the configuration in /tmp/calamares-root-tj8ntf4c/etc/nixos/configuration.nix...
these 311 derivations will be built:

My guess is a firmware error on the part of your laptop manufacturer.

It might work-around this by setting the following (it may be set to true in your hardware-configuration.nix, in which case change it):

boot.loader.efi.canTouchEfiVariables = false;

It seems like you’re using calamares, which is probably the first mistake.

Use the manual install section in the manual here: https://nixos.org/manual/nixos/stable/#sec-installation-manual

You can still partition using gparted or whatever graphical tool, and keep using the same iso, just close out the graphical installer (calamares), generate the config, and use nixos-install as explained there.

Then, if you still see the error below:

you may need to change boot.loader.efi.canTouchEfiVariables, as mentioned.

If you still get stuck, feel free to ask.

Thank you very much for the replies.
I tried manually installing the OS with the changes you recommended me.

boot.loader.efi.canTouchEfiVariables = false;

nixos-install. Everything is being downloaded. Building /nix/store packages. I create my password and reboot. It fails to boot.
I remove the usb drive and theres nothing.

I check the bios. It is indeed set to UEFI.

I try again. This time boot.loader.efi.canTouchEfiVariables = true;
‘boot.loader.systemd-boot.enable = true;’ (btw)

and this is the output

installing the boot loader...
setting up /etc...
Created "/boot/EFI".
Created "/boot/EFI/systemd".
Created "/boot/EFI/BOOT".
Created "/boot/loader".
Created "/boot/loader/keys".
Created "/boot/loader/entries".
Created "/boot/EFI/Linux".
Copied "/nix/store/d84f8nm2na5cr53m4jk0qk2mj7lgr9fx-systemd-257.9/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/systemd/systemd-bootx64.efi".
Copied "/nix/store/d84f8nm2na5cr53m4jk0qk2mj7lgr9fx-systemd-257.9/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/BOOT/BOOTX64.EFI".
Random seed file /boot/loader/random-seed successfully written (32 bytes).
Not booted with EFI, skipping EFI variable setup.
Not booted with EFI, skipping EFI variable setup.
setting up /etc...
setting up /etc...
setting root password...
New password: 
Retype new password: 
passwd: password updated successfully
installation finished!

It was the end of the output.
I will reboot and see if it works.

didn’t work. I will try using GRUB. But I would like if it were to work using systemd

So you’ve made it past the installation error? Can you be more specific than “fails”?

What laptop is this? There was an era during the transition phase to UEFI when it was particularly buggy, and many firmwares just didn’t follow the specs correctly. If your laptop is from that era, you may have to delve into the hardware-specific workarounds of the time. Even if it isn’t from that time, certainly sounds like quirky hardware, so knowing what it is would help.

I’d also suggest upgrading the firmware.