doc/nix.md
If you have the Nix package manager installed, you can build and run the editor in one command:
nix run .
This automatically installs the required build dependencies and compiles Redot if a matching binary does not already exist.
You can pass SCons build flags directly through nix run:
# Build with custom SCons flags, then run the editor.
nix run . -- target=editor dev_build=yes num_jobs=12
# Build a release template.
nix run . -- target=template_release production=yes
# Pass SCons build flags first, then `--`, then runtime args for the editor.
nix run . -- target=editor dev_build=yes -- --path /tmp/project
Argument handling works like this:
-- is consumed by Nix.-- are passed to scons.-- are passed to the built Redot binary.For a quick reminder of the wrapper syntax, run:
nix run . -- --help
This supports the same SCons flags documented by the build system, such as production=yes, target=template_release, module_mono_enabled=yes, precision=double, ccflags=..., and more.
The wrapper only uses a subset of those flags when deciding which existing binary can be reused: target, arch, dev_build, precision, threads, and extra_suffix. Other SCons flags such as production=yes, module_mono_enabled=yes, or custom ccflags are still forwarded to scons, but they do not change the wrapper's reuse check.
nix developFor full manual control over the build process:
# Enter the Nix development environment.
nix develop
# Build Redot (use 'macos' on macOS, 'linuxbsd' on Linux).
scons platform=linuxbsd # or: scons platform=macos
# Example with extra build flags.
scons platform=linuxbsd target=template_release production=yes
# Run the editor - binary names can include optional suffixes.
# Examples:
# redot.linuxbsd.editor.x86_64
# redot.linuxbsd.editor.dev.x86_64
# redot.linuxbsd.editor.double.x86_64
# redot.linuxbsd.editor.x86_64.nothreads
./bin/redot.<platform>.<target>[.dev][.double].<arch>[.nothreads][.<extra_suffix>]
nix run . only auto-builds when the expected binary for the wrapper-managed naming fields does not exist yet.nix develop and run scons manually.arch=auto resolves to the host architecture.