summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/libstore/globals.cc12
-rw-r--r--nix/nix-daemon/guix-daemon.cc23
2 files changed, 10 insertions, 25 deletions
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc
index 130b0937fd..69f6d06563 100644
--- a/nix/libstore/globals.cc
+++ b/nix/libstore/globals.cc
@@ -141,18 +141,6 @@ void Settings::update()
     _get(gcKeepDerivations, "gc-keep-derivations");
     _get(autoOptimiseStore, "auto-optimise-store");
     _get(envKeepDerivations, "env-keep-derivations");
-
-    string subs = getEnv("NIX_SUBSTITUTERS", "default");
-    if (subs == "default") {
-        substituters.clear();
-#if 0
-        if (getEnv("NIX_OTHER_STORES") != "")
-            substituters.push_back(nixLibexecDir + "/nix/substituters/copy-from-other-stores.pl");
-#endif
-        substituters.push_back(nixLibexecDir + "/nix/substituters/download-using-manifests.pl");
-        substituters.push_back(nixLibexecDir + "/nix/substituters/download-from-binary-cache.pl");
-    } else
-        substituters = tokenizeString<Strings>(subs, ":");
 }
 
 
diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc
index 8fdab2d116..23ef46ef8c 100644
--- a/nix/nix-daemon/guix-daemon.cc
+++ b/nix/nix-daemon/guix-daemon.cc
@@ -1,5 +1,5 @@
 /* GNU Guix --- Functional package management for GNU
-   Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+   Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
    Copyright (C) 2006, 2010, 2012, 2014 Eelco Dolstra <e.dolstra@tudelft.nl>
 
    This file is part of GNU Guix.
@@ -499,22 +499,19 @@ main (int argc, char *argv[])
 
       if (settings.useSubstitutes)
 	{
-	  string subs = getEnv ("NIX_SUBSTITUTERS", "default");
-
-	  if (subs == "default")
-	    {
-	      string subst =
-		settings.nixLibexecDir + "/guix/substitute";
-	      setenv ("NIX_SUBSTITUTERS", subst.c_str (), 1);
-	    }
+	  /* XXX: Hack our way to use the 'substitute' script from
+	     'LIBEXECDIR/guix' or just 'LIBEXECDIR', depending on whether
+	     we're running uninstalled or not.  */
+	  const string subdir = getenv("GUIX_UNINSTALLED") != NULL
+	    ? "" : "/guix";
+
+	  settings.substituters.push_back (settings.nixLibexecDir
+					   + subdir + "/substitute");
 	}
       else
 	/* Clear the substituter list to make sure nothing ever gets
 	   substituted, regardless of the client's settings.  */
-	setenv ("NIX_SUBSTITUTERS", "", 1);
-
-      /* Effect the $NIX_SUBSTITUTERS change.  */
-      settings.update ();
+	settings.substituters.clear ();
 
       if (geteuid () == 0 && settings.buildUsersGroup.empty ())
 	fprintf (stderr, _("warning: daemon is running as root, so \