genericBuild: command not found

I’m currently in the process of switching my configuration to flakes. Adding a simple flake.nix:

{	
	inputs = {
		nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
		home-manager = {
			url = "github:nix-community/home-manager/release-25.11";
			inputs.nixpkgs.follows = "nixpkgs";
		};
	};

	outputs = inputs@{ self, nixpkgs, home-manager, ... }: {
		nixosConfigurations.toaster = nixpkgs.lib.nixosSystem {
			system = "x86_64-linux";
			modules = [ 
				./configuration.nix
				home-manager.nixosModules.home-manager
			];
		};
	};
}

results in the following errors when running nixos-rebuild switch:

error: Cannot build '/nix/store/ydda4cc8ac6qidsfdidshkz1y5s75x75-builder.pl.drv'.
       Reason: builder failed with exit code 127.
       Output paths:
         /nix/store/8rrk76xjrp5s0v35ij1cdb2ymp2dsrki-builder.pl
       Last 1 log lines:
       > /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh: line 1: genericBuild: command not found
       For full logs, run:
         nix log /nix/store/ydda4cc8ac6qidsfdidshkz1y5s75x75-builder.pl.drv
error: Cannot build '/nix/store/9f9iyf7j72pai8vhjp0lyyk6xglgvzwh-etc-X11-xorg.conf.d-00-keyboard.conf.drv'.
       Reason: builder failed with exit code 127.
       Output paths:
         /nix/store/67ifpvqrjk0931nz9309171jn7vhxyi0-etc-X11-xorg.conf.d-00-keyboard.conf
       Last 1 log lines:
       > /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh: line 1: genericBuild: command not found
       For full logs, run:
         nix log /nix/store/9f9iyf7j72pai8vhjp0lyyk6xglgvzwh-etc-X11-xorg.conf.d-00-keyboard.conf.drv
error: Cannot build '/nix/store/3jkqgpcv7yqd9y8lqq3sjnfa0dj8csd2-mounts.sh.drv'.
       Reason: builder failed with exit code 127.
       Output paths:
         /nix/store/ky9pj40f08wx5b2cvzd99r79s8dlp03b-mounts.sh
       Last 1 log lines:
       > /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh: line 1: genericBuild: command not found
       For full logs, run:
         nix log /nix/store/3jkqgpcv7yqd9y8lqq3sjnfa0dj8csd2-mounts.sh.drv
error: Cannot build '/nix/store/zk4abzg5hxgzlqnzbv6asp3fk3q0ip3d-nixos-system-toaster-25.11.20260401.bcd464c.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/bzmy9qfjqwqdqpsj8jdy032jc95cf8ai-nixos-system-toaster-25.11.20260401.bcd464c
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '/etc/nixos#nixosConfigurations."toaster".config.system.build.toplevel' --no-link' returned non-zero exit status 1.

Building works fine without using flakes.

Edit: full configuration

Someone else from the discord reported a similar issue recently, for them a store repair helped.

So please:

  1. sudo nix-collect-garbage -d
  2. sudo nix-store --verify --check-contents --repair
  3. Reboot
  4. sudo nix-collect-garbage -d
  5. sudo nix-store --verify --check-contents --repair

This procedure usually is able to fix most issues.

If any broken path remains, you have to find another way to get rid of it.

1 Like