Install-info: Cannot allocate memory for gzip -d

I’m getting that error when running sudo nixos-rebuild switch after running sudo nix-channel --update.
Now I can’t switch/build nixos configuration anymore, even if I rollback nix-channel

Here is full log:

✗ sudo nixos-rebuild switch
building Nix...
building the system configuration...
these 17 derivations will be built:
  /nix/store/15zsjpsza7pgblkq8v3acvx46hz9q518-system-generators.drv
  /nix/store/r48573dgivi6mnmznzpprf7gyrzb625r-system-path.drv
  /nix/store/r801fg3csw0cp9a6wr0ni0q58g165aqx-dbus-1.drv
  /nix/store/dra78h9cs8ydvazxjlirckpahw37j0w8-unit-dbus.service.drv
  /nix/store/gzl707a7n86x9iisk8wvlsjfdk3f6bp2-unit-accounts-daemon.service.drv
  /nix/store/h1hx478x7rfkakya6ww8iblx13g505gp-unit-polkit.service.drv
  /nix/store/vf5dx4arj835kbxfxfnis3i6s3clvai1-unit-display-manager.service.drv
  /nix/store/wf53js6npbqvbz43cy6i1midrxw0isyz-unit-systemd-fsck-.service.drv
  /nix/store/1nkxkkvy4smnmbazk314ba4pncnyvk95-system-units.drv
  /nix/store/3drq8plybrvrd0zfd37g7a1narv173k5-opengl-drivers.drv
  /nix/store/80kl5s0ldhr15a0sck06z2zwgw4asg3h-unit-dbus.service.drv
  /nix/store/drrkkqbrs1bbp504lnd8vi077lbp2bj4-user-units.drv
  /nix/store/i7xj4whb3z3ghprnl0ykh16wvc7mrxwx-nixos-tmpfiles.d.drv
  /nix/store/qzxv8ypdh9aidfill56fq46k4jllm9vh-tmpfiles.d.drv
  /nix/store/v7yksqqfsdy2dbniy9vrfsbjxg8w83r3-system-shutdown.drv
  /nix/store/p44360qwc77qj05al1slrm5yy9g4nr7d-etc.drv
  /nix/store/br6inq7vqnna5k1n80a619lvq3907yf6-nixos-system-thinkpad-21.05pre290427.673aea9f84c.drv
building '/nix/store/r48573dgivi6mnmznzpprf7gyrzb625r-system-path.drv'...
building '/nix/store/vf5dx4arj835kbxfxfnis3i6s3clvai1-unit-display-manager.service.drv'...
building '/nix/store/3drq8plybrvrd0zfd37g7a1narv173k5-opengl-drivers.drv'...
building '/nix/store/15zsjpsza7pgblkq8v3acvx46hz9q518-system-generators.drv'...
building '/nix/store/v7yksqqfsdy2dbniy9vrfsbjxg8w83r3-system-shutdown.drv'...
created 155 symlinks in user environment
building '/nix/store/i7xj4whb3z3ghprnl0ykh16wvc7mrxwx-nixos-tmpfiles.d.drv'...
building '/nix/store/qzxv8ypdh9aidfill56fq46k4jllm9vh-tmpfiles.d.drv'...
created 8168 symlinks in user environment
install-info: Cannot allocate memory for gzip -d
error: builder for '/nix/store/r48573dgivi6mnmznzpprf7gyrzb625r-system-path.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/br6inq7vqnna5k1n80a619lvq3907yf6-nixos-system-thinkpad-21.05pre290427.673aea9f84c.drv' failed to build

Currently, I’m using nix version 2.4pre20210503 and nixos-unstable channel. How can I fix that

This issue explains what’s up and discusses workarounds: https://github.com/NixOS/nixpkgs/issues/124215

That does solve the problem. Thank you very much.