Nix run --override-input from flake lock

The nixGL docs state that

You need to specify the same version of nixpkgs that your program is using. For example, replace nixos-21.11 with nixos-21.05.

nix run --override-input nixpkgs nixpkgs/nixos-21.11 --impure github:guibou/nixGL -- program

If the version that my program is using is specified by flake.{nix,lock}, how can I instruct --override-input to use whatever is specified there?

For that case use --inputs-from instead of --override-input.