The system variable is used from the (possibly polluted) shell environment. This causes nixos-install to fail in a nix-shell because the system shell variable is automatically set to the current system (e.g. x86_64-linux).