Can't rebuild system

I followed this video to obtain a single unstable package.
After setting everything up, I did sudo nixos-rebuild switch –flake .#yelloween
This for some reason ended up taking long, around a few minutes long. That’s noticably longer than a default rebuild. At the end of the rebuild, I got an error which I assume is the same that I’m getting now?
I tried an older generation, but I still get this error.
I can no longer rebuild my system.

Here’s the traceback:

  File "/nix/store/zxcil3xmw3c8lr57vmg55l2y5vhxh93i-systemd-boot/bin/systemd-boot", line 452, in <module>
    main()
    ~~~~^^
  File "/nix/store/zxcil3xmw3c8lr57vmg55l2y5vhxh93i-systemd-boot/bin/systemd-boot", line 435, in main
    install_bootloader(args)
    ~~~~~~~~~~~~~~~~~~^^^^^^
  File "/nix/store/zxcil3xmw3c8lr57vmg55l2y5vhxh93i-systemd-boot/bin/systemd-boot", line 400, in install_bootloader
    raise e
  File "/nix/store/zxcil3xmw3c8lr57vmg55l2y5vhxh93i-systemd-boot/bin/systemd-boot", line 389, in install_bootloader
    write_entry(*gen, machine_id, bootspec, current=is_default)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/zxcil3xmw3c8lr57vmg55l2y5vhxh93i-systemd-boot/bin/systemd-boot", line 185, in write_entry
    kernel = copy_from_file(bootspec.kernel)
  File "/nix/store/zxcil3xmw3c8lr57vmg55l2y5vhxh93i-systemd-boot/bin/systemd-boot", line 177, in copy_from_file
    copy_if_not_exists(store_file_path, BOOT_MOUNT_POINT / efi_file_path)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/zxcil3xmw3c8lr57vmg55l2y5vhxh93i-systemd-boot/bin/systemd-boot", line 69, in copy_if_not_exists
    shutil.copyfile(source, tmppath)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/nix/store/cdaifv92znxy5ai4sawricjl0p5b9sgf-python3-3.13.11/lib/python3.13/shutil.py", line 273, in copyfile
    _fastcopy_sendfile(fsrc, fdst)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/nix/store/cdaifv92znxy5ai4sawricjl0p5b9sgf-python3-3.13.11/lib/python3.13/shutil.py", line 164, in _fastcopy_sendfile
    raise err from None
  File "/nix/store/cdaifv92znxy5ai4sawricjl0p5b9sgf-python3-3.13.11/lib/python3.13/shutil.py", line 150, in _fastcopy_sendfile
    sent = os.sendfile(outfd, infd, offset, blocksize)
OSError: [Errno 28] No space left on device: '/nix/store/bfyzwq2wg845j3nwk4cnyg00zml4xznc-linux-6.12.65/bzImage' -> '/boot/EFI/nixos/bfyzwq2wg845j3nwk4cnyg00zml4xznc-linux-6.12.65-bzImage.efikt_fuv1w.tmp.'
Failed to install bootloader
Command 'systemd-run -E LOCALE_ARCHIVE -E NIXOS_INSTALL_BOOTLOADER --collect --no-ask-password --pipe --quiet --service-type=exec --unit=nixos-rebuild-switch-to-configuration /nix/store/xxk6sil0cjzdnpxlqci36aq427s35v8d-nixos-system-nixos-25.11.20260117.72ac591/bin/switch-to-configuration switch' returned non-zero exit status 1.```

You’re out of space on /boot. You’ll want to get rid of old generations and reduce your configurationLimit.


The long rebuild in turn might mean anything (including “nothing wrong”, but in that scenario I’d say “inadvisable”); It’s even possible this is causing your space issues if you did some wonky things with lanzaboote or kernel modules.

Rather than force me to watch a video, mind sharing the configuration you ended up with?

1 Like

My flake.nix file was something along the lines of this:

{

  description = "flake";
  
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
    spicetify-nix.url = "github:gerg-l/spicetify-nix";
    niri-flake.url = "github:sodiboo/niri-flake";
  };

  outputs = { self, nixpkgs, nixpkgs-unstable, spicetify-nix, niri-flake, ... }:
  let 
    system = "x86_64-linux";
    lib = nixpkgs.lib;
    pkgs = nixpkgs.legacyPackages.${system};
    pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
  in {
    nixosConfigurations = {
      yelloween = lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./configuration.nix
          spicetify-nix.nixosModules.default
          niri-flake.nixosModules.niri
        ];
        specialArgs = {
          inherit pkgs-unstable;
        };
      };
    };
  };
}

And in my configuration.nix file, I tried using the unstable package in this way:
services.udev.packages = [ pkgs-unstable.openrgb ];
(It was an attempt to get the latest udev rules for OpenRGB, but that’s not important now)

That looks fine, albeit a bit tautological.

The issues will be in ./configuration.nix.

1 Like

I don’t think I can find the state of configuration.nix at the time of the initial error, since I tried doing nix-collect-garbage -d to fix the issue. I thought about it, and I don’t think I’ve changed anything else other than adding pkgs-unstable to the top of the file this way:
{ config, pkgs, pkgs-unstable, inputs, lib, ... };
and this line as I’ve shown before:
services.udev.packages = [ pkgs-unstable.openrgb ];

Your configuration should be in a git repo that you commit to often, but that’s irrelevant to the error. You just need to clear out /boot and delete old generations as mentioned.

You may also need to increase the size of your boot partition. I would recommend at least half a gigabyte to a gigabyte.

2 Likes

Though this will eventually also fill up unless you set a configurationLimit.

For the record, the question about your configuration.nix is to try and figure out why your rebuilds are taking longer; the error is obviously because you ran out of disk space.

2 Likes

I was planning on doing that soon, but I kept delaying it :sweat_smile:. I’ll do that and set the configurationLimit as soon as possible when I’m done.

How would I do this safely?

1 Like

Just to be extra careful, I’m supposed to delete the older nixos-generation-number.conf files inside of /boot/loader/entries/, and the .efi files inside of /boot/EFI/nixos/ right?

Thank you all so much for helping. The issue is resolved after cleaning /boot and running sudo nix-collect-garbage -d again.