summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-12-16 18:09:27 +0100
committerLudovic Courtès <ludo@gnu.org>2012-12-16 18:09:27 +0100
commit72ce03739e24d9e2908342fc0e6384e6dfb802f5 (patch)
treebea3c25d2ef4962c0dbda011c5e51bf2fa4ac501 /nix
parent07ab4bf1fc590642307f18b4d1b8687dde3d664b (diff)
downloadguix-72ce03739e24d9e2908342fc0e6384e6dfb802f5.tar.gz
daemon: Add `--chroot-directory'.
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_CHROOT_DIR): New macro.
  (options): Add `--chroot-directory'.
  (parse_opt): Handle it.
Diffstat (limited to 'nix')
-rw-r--r--nix/nix-daemon/guix-daemon.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc
index 79c719399e..0e72b1d219 100644
--- a/nix/nix-daemon/guix-daemon.cc
+++ b/nix/nix-daemon/guix-daemon.cc
@@ -58,6 +58,7 @@ builds derivations on behalf of its clients.";
 #define GUIX_OPT_DISABLE_STORE_OPTIMIZATION 7
 #define GUIX_OPT_IMPERSONATE_LINUX_26 8
 #define GUIX_OPT_DEBUG 9
+#define GUIX_OPT_CHROOT_DIR 10
 
 static const struct argp_option options[] =
   {
@@ -74,6 +75,13 @@ static const struct argp_option options[] =
       "this option has no effect)"
 #endif
     },
+    { "chroot-directory", GUIX_OPT_CHROOT_DIR, "DIR", 0,
+      "Add DIR to the build chroot"
+#ifndef HAVE_CHROOT
+      " (chroots are not supported in this configuration, so "
+      "this option has no effect)"
+#endif
+    },
     { "build-users-group", GUIX_OPT_BUILD_USERS_GROUP, "GROUP", 0,
       "Perform builds as a user of GROUP" },
     { "cache-failures", GUIX_OPT_CACHE_FAILURES, 0, 0,
@@ -104,6 +112,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
     case GUIX_OPT_DISABLE_CHROOT:
       settings.useChroot = false;
       break;
+    case GUIX_OPT_CHROOT_DIR:
+      settings.dirsInChroot.insert (arg);
+      break;
     case GUIX_OPT_DISABLE_LOG_COMPRESSION:
       settings.compressLog = false;
       break;