Does installing an old version of a package always require a massive recompile?

I wanted to install the previous version of R, so I used Nix Package Versions to find the command:

nix-shell -p R -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/824421b1796332ad1bcb35bc7855da832c43305f.tar.gz

It triggered the downloading of seemingly every recursive dependency and has been compiling them for the past couple hours (currently churning through glibc). Is this expected? There’s no way to install binary versions of old packages?

EDIT:
And does the situation change if I want to run a version of R that I had previously installed before updating my whole system?

This commit was not built by Hydra (and because it was a mass rebuild, no build results are cached. The closest commit that was cached is f167a1272d277d32de79a07443b21af715396b29 (found by looking at the Hydra job history):

nix-shell -p R -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/f167a1272d277d32de79a07443b21af715396b29.tar.gz
2 Likes