Little fortress. Maximum of four map squares - more means A LOT more time to get it done.
Magma pipe and water (aquifer in one-square-nanofortress is the only way).
The most flat terrain recommended.
And two possible ways to do all the work painlessly - iron/bauxite (with goblins or free@smelter) or modded obsidian melting temperature.
1. Build the raising bridges leaving one/two-tile corridor at all the borders - to obsidianize the borders, making them impassable.
2. Bridge up the whole layer some levels higher (with central stairs) to make the water dissipation system (to help in obsidianising-the-borders process)
3. When all the borders are done - we'll get no invaders and won't let anybody get out as only Dtil ;-) can mine out boundary tiles now.
4. Now build the containers for magma (30*30 tiles with 2 z-level height maximum, but even 35*35*1z will be enough)
5. The same container with additional zlevel of height for water with releasing bridges or preconstructed cave-in'ing system (must be independent with magma!)
6. The side view of the project:
wwwwwwwwwwwwwwwww - TWO water levels
--------------------------- - bridge level
mmmmmmmmmmmmmmmmm - magma level
--------------------------- - bridge level
....................................... - empty level
zzzzzzzzzzzzzzzzzzzzzzzzzzzz - roof bridge level (here will be some floor tiles for material stockpiles)
Somewhere in the center of this will be stairs between isolation walls.
Roof and magma holding bridge must be of magma-proof material, other must be of burning/melting material.
So. Prepare the stockpiles, fill the containers with supposed fluids, deconstruct stairs starting from the top, floor the stair hole in the roof, victimizing the mason dwarf on the top.
And pull the levers.
Obsidianized roof can't be deconstructed.
Obsidianized border tiles can't be mined.
Voila.