Merge remote-tracking branch 'origin/master' into flakes

This commit is contained in:
Eelco Dolstra 2020-04-01 00:03:50 +02:00
commit 4fdec5f61d
6 changed files with 10 additions and 23 deletions

View file

@ -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;
}

View file

@ -6,7 +6,7 @@
using namespace nix;
struct CmdBuild : MixDryRun, MixProfile, InstallablesCommand
struct CmdBuild : InstallablesCommand, MixDryRun, MixProfile
{
Path outLink = "result";

View file

@ -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;

View file

@ -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>

View file

@ -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)"
},
};
}

View file

@ -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