> For the complete documentation index, see [llms.txt](https://cristiandis.gitbook.io/ntix/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cristiandis.gitbook.io/ntix/configuration/multi-environment.md).

# Multi-Environment

## Multi-Environment

Split your config across files with `import()`.

### Root config

```lua
local env = os.getenv("NTIX_ENV") or "work.dev"

if env == "work.dev" then
    import("environments/work/dev.lua")
elseif env == "work.gaming" then
    import("environments/work/gaming.lua")
end

return { options = options, pkgs = pkgs }
```

### Import syntax

```lua
import("packages/winget.lua")
import({ "./base.lua", "../../packages/scoop.lua" })
```

Paths are relative to the importing file.
