You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The directory on the host, in which derivations' temporary build directories are created.
701
-
702
-
If not set, Nix uses the system temporary directory indicated by the `TMPDIR` environment variable.
703
-
Note that builds are often performed by the Nix daemon, so its `TMPDIR` is used, and not that of the Nix command line interface.
704
-
705
-
This is also the location where [`--keep-failed`](@docroot@/command-ref/opt-common.md#opt-keep-failed) leaves its files.
706
-
707
-
If Nix runs without sandbox, or if the platform does not support sandboxing with bind mounts (e.g. macOS), then the [`builder`](@docroot@/language/derivations.md#attr-builder)'s environment contains this directory instead of the virtual location [`sandbox-build-dir`](#conf-sandbox-build-dir).
700
+
Override the `build-dir` store setting for all stores that have this setting.
The directory on the host, in which derivations' temporary build directories are created.
47
+
48
+
If not set, Nix will use the `builds` subdirectory of its configured state directory.
49
+
50
+
Note that builds are often performed by the Nix daemon, so its `build-dir` applies.
51
+
52
+
Nix will create this directory automatically with suitable permissions if it does not exist.
53
+
Otherwise its permissions must allow all users to traverse the directory (i.e. it must have `o+x` set, in unix parlance) for non-sandboxed builds to work correctly.
54
+
55
+
This is also the location where [`--keep-failed`](@docroot@/command-ref/opt-common.md#opt-keep-failed) leaves its files.
56
+
57
+
If Nix runs without sandbox, or if the platform does not support sandboxing with bind mounts (e.g. macOS), then the [`builder`](@docroot@/language/derivations.md#attr-builder)'s environment will contain this directory, instead of the virtual location [`sandbox-build-dir`](#conf-sandbox-build-dir).
58
+
59
+
> **Warning**
60
+
>
61
+
> `build-dir` must not be set to a world-writable directory.
62
+
> Placing temporary build directories in a world-writable place allows other users to access or modify build data that is currently in use.
63
+
> This alone is merely an impurity, but combined with another factor this has allowed malicious derivations to escape the build sandbox.
0 commit comments