Most of what @intrepidhero says is correct, but they've missed enough to make a separate answer worthwhile, I think.
So, as they said, the basic premise of nanorobotics is to manipulate matter down to the molecular and atomic scale. This is something life is already good at and, although we have the perception that life tends to avoid machine-like choices, close to the nanoscale, that changes. For example, our cells are quite often powered by a three-stroke molecular engine powered by ADP/ATP See here for details
So, it's likely that the first true nanomachines are likely to be synthetic life, since it's easier to adapt what we have now to make it do new and interesting stuff than it is to create new stuff on our own.
In all nanomachinery, construction is at the molecular scale and this creates a whole host of problems. For one thing, all nanomachinery is subject to kinetic impacts from Brownian motion, as well as being hit by radiation and other things, which at that scale are more like bullets than anything else.
If you look at an ATP motor in action, you'll see it work jerkily, sometimes going backwards, mainly going in the direction its supposed to go, as it's jerked around and pelted by molecules.
Nanomachinery needs information storage too, for how to build something according to a plan. In our cells, this is provided by DNA. DNA is scarily dense as an information medium. Our genome contains ~800Mb of information per cell. Construction is done through basically flocking behavior (the stuff you get with AI descriptions or birds, for example), with cells and components not necessarily aware what is going on separately from them, while chemical triggers cause certain things to happen (e.g. the sex hormones trigger certain characteristics in humans and these triggers work even after puberty because our cells are keyed to respond).
Because DNA is a molecular encoding system, its massively prone to mutation by Brownian motion and radiation (among other things). Any nanomachinery will suffer the same problem and designs will have to be careful, though DNA is greatly resistant to a lot of change and we have nanomachinery which fixes a lot of errors in our code. There might be other schemes out there which are better/more resistant.
Viruses are not the smallest manipulating parts of matter, they're actually rogue bits of self-replicating code designed to be executed by cells.
You might also want to read about soft condensed matter physics, which gives an example for how, by controlling a couple of variables, you can use soapy particles to make cell walls without much fuss. Also, bioprinting talks about how cells self-organise if you put them together.
All of that being background, to build the kind of structures you're envisioning (and I think I know the computer games you've been playing to have this idea), you've got cell-like structures, with DNA-like molecules in them programming them, laying down metal structures probably one atom at a time, according to some patterns dictated by the change of chemical gradients in the mixture according to a semi-random pattern that mostly creates what you want, powered by some kind of chemical power source.
So, adapting this to answer your question, you'd have a bunch of nano-paste type stuff, which would be the cell-type things, you spread that on your resources, like you've said, you tell a quantum computer what you want and the quantum computer creates the DNA-analogue in a molecular fabricator, which spreads through the paste and enters the cells/machines in the paste like a virus, causing them to activate. A power source produces an ADP/ATP analogue to power the goop which is what gets it going (unless it can get energy from dissolving the resource or some other way).
This goop will probably dissolve the building materials into the paste, at which point, you inject the goop into structures with bits of appropriate new DNA-analogue which contains the building instructions from each part. The cells start to process the new instructions created by the quantum computer and the nutrients are spun onto the structures or (for more complicated bits) into their own shapes. Putting different DNA-analogue stuff into different sections at different times controls the spinning out process and gets you different things.