1DIRENV.TOML 1 "2019" direnv "User Manuals" 2========================================== 3 4NAME 5---- 6 7direnv.toml - the direnv configuration file 8 9DESCRIPTION 10----------- 11 12A configuration file in [TOML](https://github.com/toml-lang/toml) format to specify a variety of configuration options for direnv. Read from at CONFIGURATION_DIR/direnv.toml or $DIRENV_CONFIG/direnv.toml. For many users, CONFIGURATION_DIR will be located at $HOME/.config/direnv/direnv.toml. 13 14FORMAT 15------ 16 17See the [TOML GitHub Repository](https://github.com/toml-lang/toml) for details about the syntax of the configuration file. 18 19CONFIG 20------ 21 22The configuration is specified in sections which each have their own top-level [tables](https://github.com/toml-lang/toml#table), with key/value pairs specified in each section. 23 24Example: 25 26```toml 27[section] 28key = "value" 29``` 30 31The following sections are supported: 32 33## [global] 34 35### `bash_path` 36 37This allows one to hard-code the position of bash. It maybe be useful to set this to avoid having direnv to fail when PATH is being mutated. 38 39### `disable_stdin` 40 41If set to `true`, stdin is disabled (redirected to /dev/null) during the `.envrc` evaluation. 42 43### `strict_env` 44 45If set to true, the `.envrc` will be loaded with `set -euo pipefail`. This 46option will be the default in the future. 47 48### `warn_timeout` 49 50Specify how long to wait before warning the user that the command is taking 51too long to execute. Defaults to "5s". 52 53A duration string is a possibly signed sequence of decimal numbers, each with 54optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". 55Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". 56 57## [whitelist] 58 59Specifying whitelist directives marks specific directory hierarchies or specific directories as "trusted" -- direnv will evaluate any matching .envrc files regardless of whether they have been specifically allowed. **This feature should be used with great care**, as anyone with the ability to write files to that directory (including collaborators on VCS repositories) will be able to execute arbitrary code on your computer. 60 61There are two types of whitelist directives supported: 62 63### `prefix` 64 65Accepts an array of strings. If any of the strings in this list are a prefix of an .envrc file's absolute path, that file will be implicitly allowed, regardless of contents or past usage of `direnv allow` or `direnv deny`. 66 67Example: 68 69```toml 70[whitelist] 71prefix = [ "/home/user/code/project-a" ] 72``` 73 74In this example, the following .envrc files will be implicitly allowed: 75 76* `/home/user/code/project-a/.envrc` 77* `/home/user/code/project-a/subdir/.envrc` 78* and so on 79 80In this example, the following .envrc files will not be implicitly allowed (although they can be explicitly allowed by running `direnv allow`): 81 82* `/home/user/project-b/.envrc` 83* `/opt/random/.envrc` 84 85### `exact` 86 87Accepts an array of strings. Each string can be a directory name or the full path to an .envrc file. If a directory name is passed, it will be treated as if it had been passed as itself with `/.envrc` appended. After resolving the filename, each string will be checked for being an exact match with an .envrc file's absolute path. If they match exactly, that .envrc file will be implicitly allowed, regardless of contents or past usage of `direnv allow` or `direnv deny`. 88 89Example: 90 91```toml 92[whitelist] 93exact = [ "/home/user/project-b/.envrc", "/home/user/project-b/subdir-a" ] 94``` 95 96In this example, the following .envrc files will be implicitly allowed, and no others: 97 98* `/home/user/code/project-b/.envrc` 99* `/home/user/code/project-b/subdir-a` 100 101In this example, the following .envrc files will not be implicitly allowed (although they can be explicitly allowed by running `direnv allow`): 102 103* `/home/user/code/project-b/subproject-c/.envrc` 104* `/home/user/code/.envrc` 105 106COPYRIGHT 107--------- 108 109MIT licence - Copyright (C) 2019 @zimbatm and contributors 110 111SEE ALSO 112-------- 113 114direnv(1), direnv-stdlib(1) 115