aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-04 21:04:35 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-04 21:04:35 +0000
commite5cc1ebc5db1ef837da82f5ce7824bb29cbcc44b (patch)
tree42d659874572b812526596f6534ffe884e77080f /src/nix
parenta7b82fd006606dad591f8da88907e79b4c87b1f7 (diff)
parent0f44b60e6dc999697bf9f2a4b3652a0551016598 (diff)
Merge remote-tracking branch 'upstream/master' into no-stringly-typed-derivation-output
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/add-to-store.cc6
-rw-r--r--src/nix/develop.cc (renamed from src/nix/dev-shell.cc)14
-rw-r--r--src/nix/local.mk2
-rw-r--r--src/nix/main.cc2
4 files changed, 14 insertions, 10 deletions
diff --git a/src/nix/add-to-store.cc b/src/nix/add-to-store.cc
index 4b4ba81cb..f43f774c1 100644
--- a/src/nix/add-to-store.cc
+++ b/src/nix/add-to-store.cc
@@ -50,8 +50,10 @@ struct CmdAddToStore : MixDryRun, StoreCommand
info.narSize = sink.s->size();
info.ca = makeFixedOutputCA(FileIngestionMethod::Recursive, info.narHash);
- if (!dryRun)
- store->addToStore(info, sink.s);
+ if (!dryRun) {
+ auto source = StringSource { *sink.s };
+ store->addToStore(info, source);
+ }
logger->stdout("%s", store->printStorePath(info.path));
}
diff --git a/src/nix/dev-shell.cc b/src/nix/develop.cc
index 337d7750e..adfb3558d 100644
--- a/src/nix/dev-shell.cc
+++ b/src/nix/develop.cc
@@ -110,7 +110,7 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath)
auto builder = baseNameOf(drv.builder);
if (builder != "bash")
- throw Error("'nix dev-shell' only works on derivations that use 'bash' as their builder");
+ throw Error("'nix develop' only works on derivations that use 'bash' as their builder");
auto getEnvShPath = store->addTextToStore("get-env.sh", getEnvSh, {});
@@ -233,11 +233,11 @@ struct Common : InstallableCommand, MixProfile
}
};
-struct CmdDevShell : Common, MixEnvironment
+struct CmdDevelop : Common, MixEnvironment
{
std::vector<std::string> command;
- CmdDevShell()
+ CmdDevelop()
{
addFlag({
.longName = "command",
@@ -261,15 +261,15 @@ struct CmdDevShell : Common, MixEnvironment
return {
Example{
"To get the build environment of GNU hello:",
- "nix dev-shell nixpkgs.hello"
+ "nix develop nixpkgs.hello"
},
Example{
"To store the build environment in a profile:",
- "nix dev-shell --profile /tmp/my-shell nixpkgs.hello"
+ "nix develop --profile /tmp/my-shell nixpkgs.hello"
},
Example{
"To use a build environment previously recorded in a profile:",
- "nix dev-shell /tmp/my-shell"
+ "nix develop /tmp/my-shell"
},
};
}
@@ -343,4 +343,4 @@ struct CmdPrintDevEnv : Common
};
static auto r1 = registerCommand<CmdPrintDevEnv>("print-dev-env");
-static auto r2 = registerCommand<CmdDevShell>("dev-shell");
+static auto r2 = registerCommand<CmdDevelop>("develop");
diff --git a/src/nix/local.mk b/src/nix/local.mk
index 8c0eed19e..43b7754e3 100644
--- a/src/nix/local.mk
+++ b/src/nix/local.mk
@@ -28,4 +28,4 @@ $(eval $(call install-symlink, $(bindir)/nix, $(libexecdir)/nix/build-remote))
src/nix-env/user-env.cc: src/nix-env/buildenv.nix.gen.hh
-src/nix/dev-shell.cc: src/nix/get-env.sh.gen.hh
+src/nix/develop.cc: src/nix/get-env.sh.gen.hh
diff --git a/src/nix/main.cc b/src/nix/main.cc
index ef301580a..1120ba5ef 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -110,6 +110,8 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
.description = "consider all previously downloaded files out-of-date",
.handler = {[&]() { refresh = true; }},
});
+
+ deprecatedAliases.insert({"dev-shell", "develop"});
}
void printFlags(std::ostream & out) override