about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-02-22T11·27+0100
committerEelco Dolstra <edolstra@gmail.com>2018-02-22T11·27+0100
commitddc58e789636e1b94149c342575d92583251fbf6 (patch)
tree2b06967dda7120ca7e2c78716d711d399e9ad4a9 /src/libstore
parent6964131cd716b2ccf9d1f0a817b5cac483f87a9b (diff)
Enable sandbox builds on Linux by default
The overhead of sandbox builds is a problem on NixOS (since building a
NixOS configuration involves a lot of small derivations) but not for
typical non-NixOS use cases. So outside of NixOS we can enable it.

Issue #179.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/globals.hh8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index dd01f832df0c..12917a438fa7 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -220,7 +220,13 @@ public:
     Setting<bool> enableNativeCode{this, false, "allow-unsafe-native-code-during-evaluation",
         "Whether builtin functions that allow executing native code should be enabled."};
 
-    Setting<SandboxMode> sandboxMode{this, smDisabled, "sandbox",
+    Setting<SandboxMode> sandboxMode{this,
+        #if __linux__
+          smEnabled
+        #else
+          smDisabled
+        #endif
+        , "sandbox",
         "Whether to enable sandboxed builds. Can be \"true\", \"false\" or \"relaxed\".",
         {"build-use-chroot", "build-use-sandbox"}};