summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-04-26 16:43:08 +0200
committerLudovic Courtès <ludo@gnu.org>2013-04-26 16:43:08 +0200
commita9db7d10b6e4e86fb2b87a4161db3b1f202002fd (patch)
tree4a22481ab65447d8bc1cc307a76a884a7e7bbee9 /nix
parente33d9d6f09874f83bb5a03f49cb969a84588e10e (diff)
parent2b6bdf7eb3c95716ac107ea6caea2e0b7077ae77 (diff)
downloadguix-a9db7d10b6e4e86fb2b87a4161db3b1f202002fd.tar.gz
Merge branch 'master' into core-updates
Conflicts:
	Makefile.am
	gnu/packages/autotools.scm
	gnu/packages/guile.scm
	gnu/packages/python.scm
	gnu/packages/shishi.scm
	guix/gnu-maintenance.scm
	guix/scripts/build.scm
	guix/scripts/gc.scm
	guix/scripts/package.scm
	guix/scripts/substitute-binary.scm
	guix/ui.scm
	nix/nix-daemon/guix-daemon.cc
	test-env.in
	tests/nar.scm
	tests/store.scm
Diffstat (limited to 'nix')
-rw-r--r--nix/nix-daemon/guix-daemon.cc27
1 files changed, 18 insertions, 9 deletions
diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc
index 0e2f36150b..5f0710c256 100644
--- a/nix/nix-daemon/guix-daemon.cc
+++ b/nix/nix-daemon/guix-daemon.cc
@@ -65,6 +65,7 @@ builds derivations on behalf of its clients.";
 #define GUIX_OPT_DEBUG 9
 #define GUIX_OPT_CHROOT_DIR 10
 #define GUIX_OPT_LISTEN 11
+#define GUIX_OPT_NO_SUBSTITUTES 12
 
 static const struct argp_option options[] =
   {
@@ -90,6 +91,8 @@ static const struct argp_option options[] =
     },
     { "build-users-group", GUIX_OPT_BUILD_USERS_GROUP, "GROUP", 0,
       "Perform builds as a user of GROUP" },
+    { "no-substitutes", GUIX_OPT_NO_SUBSTITUTES, 0, 0,
+      "Do not use substitutes" },
     { "cache-failures", GUIX_OPT_CACHE_FAILURES, 0, 0,
       "Cache build failures" },
     { "lose-logs", GUIX_OPT_LOSE_LOGS, 0, 0,
@@ -152,6 +155,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
 	  exit (EXIT_FAILURE);
 	}
       break;
+    case GUIX_OPT_NO_SUBSTITUTES:
+      settings.useSubstitutes = false;
+      break;
     case GUIX_OPT_DEBUG:
       verbosity = lvlDebug;
       break;
@@ -202,18 +208,21 @@ main (int argc, char *argv[])
 
       /* Use our substituter by default.  */
       settings.substituters.clear ();
-      string subs = getEnv ("NIX_SUBSTITUTERS", "default");
-      if (subs == "default")
-	/* XXX: No substituters until we have something that works.  */
-	settings.substituters.clear ();
-	// settings.substituters.push_back (settings.nixLibexecDir
-	// 				 + "/guix/substitute-binary");
-      else
-	settings.substituters = tokenizeString<Strings> (subs, ":");
-
+      settings.useSubstitutes = true;
 
       argp_parse (&argp, argc, argv, 0, 0, 0);
 
+      if (settings.useSubstitutes)
+	{
+	  string subs = getEnv ("NIX_SUBSTITUTERS", "default");
+
+	  if (subs == "default")
+	    settings.substituters.push_back (settings.nixLibexecDir
+					     + "/guix/substitute-binary");
+	  else
+	    settings.substituters = tokenizeString<Strings> (subs, ":");
+	}
+
       if (geteuid () == 0 && settings.buildUsersGroup.empty ())
 	fprintf (stderr, "warning: daemon is running as root, so "
 		 "using `--build-users-group' is highly recommended\n");