aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-04-01 00:03:50 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-04-01 00:03:50 +0200
commit4fdec5f61d5eef5f78ecfd7cbfea491979f15ac9 (patch)
tree7b16b299944cf158d54e7487640f3864ed3083a2
parent03b56e96bfa89e82beee3f57de79d64c9f173afd (diff)
parenta7540294cfae82c098e8691cd5212a9184add574 (diff)
Merge remote-tracking branch 'origin/master' into flakes
-rw-r--r--src/libstore/build.cc2
-rw-r--r--src/nix/build.cc2
-rw-r--r--src/nix/command.hh2
-rw-r--r--src/nix/installables.hh2
-rw-r--r--src/nix/shell.cc23
-rw-r--r--src/resolve-system-dependencies/local.mk2
6 files changed, 10 insertions, 23 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 0e3a23a4d..527d7ac42 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2465,7 +2465,7 @@ void DerivationGoal::initTmpDir() {
auto hash = hashString(htSHA256, i.first);
string fn = ".attr-" + hash.to_string(Base32, false);
Path p = tmpDir + "/" + fn;
- writeFile(p, i.second);
+ writeFile(p, rewriteStrings(i.second, inputRewrites));
chownToBuilder(p);
env[i.first + "Path"] = tmpDirInSandbox + "/" + fn;
}
diff --git a/src/nix/build.cc b/src/nix/build.cc
index ae931873f..613bd9efb 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -6,7 +6,7 @@
using namespace nix;
-struct CmdBuild : MixDryRun, MixProfile, InstallablesCommand
+struct CmdBuild : InstallablesCommand, MixDryRun, MixProfile
{
Path outLink = "result";
diff --git a/src/nix/command.hh b/src/nix/command.hh
index 305ce5588..8b910ba78 100644
--- a/src/nix/command.hh
+++ b/src/nix/command.hh
@@ -171,7 +171,7 @@ std::set<StorePath> toDerivations(ref<Store> store,
filename:lineno. */
Strings editorFor(const Pos & pos);
-struct MixProfile : virtual Args, virtual StoreCommand
+struct MixProfile : virtual StoreCommand
{
std::optional<Path> profile;
diff --git a/src/nix/installables.hh b/src/nix/installables.hh
index a96b07718..8f2d50077 100644
--- a/src/nix/installables.hh
+++ b/src/nix/installables.hh
@@ -2,8 +2,8 @@
#include "util.hh"
#include "path.hh"
-#include "flake/eval-cache.hh"
#include "eval.hh"
+#include "flake/eval-cache.hh"
#include <optional>
diff --git a/src/nix/shell.cc b/src/nix/shell.cc
index bee0bddcc..439ef02ed 100644
--- a/src/nix/shell.cc
+++ b/src/nix/shell.cc
@@ -92,7 +92,7 @@ StorePath getDerivationEnvironment(ref<Store> store, Derivation drv)
{
auto builder = baseNameOf(drv.builder);
if (builder != "bash")
- throw Error("'nix shell' only works on derivations that use 'bash' as their builder");
+ throw Error("'nix dev-shell' only works on derivations that use 'bash' as their builder");
drv.args = {
"-c",
@@ -136,21 +136,6 @@ StorePath getDerivationEnvironment(ref<Store> store, Derivation drv)
struct Common : InstallableCommand, MixProfile
{
- /*
- std::set<string> keepVars{
- "DISPLAY",
- "HOME",
- "IN_NIX_SHELL",
- "LOGNAME",
- "NIX_BUILD_SHELL",
- "PAGER",
- "PATH",
- "TERM",
- "TZ",
- "USER",
- };
- */
-
std::set<string> ignoreVars{
"BASHOPTS",
"EUID",
@@ -258,7 +243,7 @@ struct CmdDevShell : Common, MixEnvironment
return {
Example{
"To get the build environment of GNU hello:",
- "nix dev-shell nixpkgs:hello"
+ "nix dev-shell nixpkgs#hello"
},
Example{
"To get the build environment of the default package of flake in the current directory:",
@@ -266,7 +251,7 @@ struct CmdDevShell : Common, MixEnvironment
},
Example{
"To store the build environment in a profile:",
- "nix dev-shell --profile /tmp/my-shell nixpkgs:hello"
+ "nix dev-shell --profile /tmp/my-shell nixpkgs#hello"
},
Example{
"To use a build environment previously recorded in a profile:",
@@ -324,7 +309,7 @@ struct CmdPrintDevEnv : Common
return {
Example{
"To apply the build environment of GNU hello to the current shell:",
- ". <(nix print-dev-env nixpkgs:hello)"
+ ". <(nix print-dev-env nixpkgs#hello)"
},
};
}
diff --git a/src/resolve-system-dependencies/local.mk b/src/resolve-system-dependencies/local.mk
index bf65f7905..f0e82e023 100644
--- a/src/resolve-system-dependencies/local.mk
+++ b/src/resolve-system-dependencies/local.mk
@@ -6,6 +6,8 @@ resolve-system-dependencies_DIR := $(d)
resolve-system-dependencies_INSTALL_DIR := $(libexecdir)/nix
+resolve-system-dependencies_CXXFLAGS += -I src/libutil -I src/libstore -I src/libmain
+
resolve-system-dependencies_LIBS := libstore libmain libutil libnixrust
resolve-system-dependencies_SOURCES := $(d)/resolve-system-dependencies.cc