Package install fails after fresh install of nix on debian bullseye

Installed nix using: curl -L which installs channel 2.11.1. I have a bash script that installs 335 packages using nix-env -iA “nixpkgs.$pkgname”. All packages install as expected except those that start with the letter ‘d’!! The packages are:
dash dateutils ddgr debootstrap dialog diffr dig dmidecode dmenu
dolphin dub dutree dzen2. Now the bizarre thing is that is not any specific
package taht fails. If I install them one by one randomly with nix-env -iA “nixpkgs.$pkgname”
one of them will err after for or five of them install ok. It is a different one each time but it always happens.

Here is an example:
installing ‘dmidecode-3.4’
this path will be fetched (0.06 MiB download, 0.20 MiB unpacked):
copying path ‘/nix/store/3vx4jfl7zn2l92mn4zrn2pb2nx5hk9s6-dmidecode-3.4’ from ‘’…
error: this derivation has bad ‘meta.outputsToInstall’

After this the store is corrupted and nothing can be installed or uninstalled.

Very weird!

Thanks in advance


Seems related to this (really weird that it only fails with packages starting with d ^^) Cannot install packages in user environment anymore on NixOS (22.05) · Issue #189555 · NixOS/nixpkgs · GitHub It was apparently solved running nix-env -u --always (that can force packages to downgrade)

Thanks for the reply. Did not seem to fix it.

  1. nix install using: curl -L
  2. nix-env -u --always gives:
    upgrading ‘nss-cacert-3.80’ to ‘nss-cacert-3.83’
    downgrading ‘nix-2.11.1’ to ‘nix-2.11.0’
  3. installs still fail at dmidecode (nix-env -iA nixpkg.$name)
    dash - ok
    dateutils - ok
    ddgr -ok
    debootstrap -ok
    dialog -ok
    diffr -ok
    dig -ok
    dmidecode gives
    error: this derivation has bad ‘meta.outputsToInstall’

If I’m doing it right.