Referencing locked dependencies from a flake on a command line

Say if I did nix shell nixpkgs#hello right now, I’d get version 2 of hello.

Say I have flake.nix and its respective flake.lock. Say that nixpkgs is locked to a version such that, if I ran nix shell nixpkgs#hello at the time that version was the latest, I’d get hello version 1.

Is there a way, without modifying the flake itself, to run nix shell nixpkgs#hello in a way to tell it to use nixpkgs not from the registry (which brings hello version 2), but from the flake (which brings hello version 1)?

In other words, is there a way to run nix shell so that it uses the locked dependencies from flake.lock instead of from the respective registries?

I should have thought of RTFMing the docs of nix shell - for the posterity:

https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-shell.html

--inputs-from flake-url

Use the inputs of the specified flake as registry entries.