How to support nix build and also cmake presets?

I have a configPreset that looks like this:

{
            "name": "linux",
            "displayName": "Linux build",
            "hidden": false,
            "inherits": ["cpp-std", "cpp-build", "ninja"],
            "environment": {
                "CXX_WARNINGS": "-Wall -Wextra -Werror -pedantic",
                "CXX_OPT": "-fsized-deallocation -fno-math-errno -march=x86-64-v3",
                "PLATFORM": "POSIX64"
            }
        }

if I run cmake --preset linux I’ll get an error regarding in-source builds since they are not supported, so I need to also add: "binaryDir": "${sourceDir}/build/${presetName}".

But then nix build will fail because it cannot find the built files since I’m assuming it doesn’t know they are in ${sourceDir}/build/${presetName}.

How do people usually deal with this issue?