Import the path given to it (parse and evaluate the contents of the file as a Nix expression)
(If the value of the expression is a function taking an attribute set, try to create an attribute set from values of --arg or --argstr flags, and call the function.)
If the value is an attribute set, it will import the attributes into the REPL scope.
Since your configuration.nix is a function and you are not providing those arguments, loading will fail in the second step as you have noticed.
However, even if you were to provide config, pkgs, etc. through --arg flags, you would just get the contents of the configuration as written in the configuration.nix. It is a NixOS module, and if you want to introspect evaluated system configuration, you will need to evaluate the module in the context of NixOS module system as Sandro suggests (see also Nix repl / system configuration - manipulate config - #7 by jtojnar).
Overriding the nixos-config does not appear to be documented in the manual except for few unexplained mentions but you can see it used on the first line of the <nixpkgs/nixos> source code.