aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-04-09 15:54:21 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-04-09 15:54:21 +0200
commitd103c79144723d95eb3650593ad4d3e96abe59d3 (patch)
tree44bc23261fe42a60afa666ab770cf8d7f55c5138 /src/nix
parent03a4a3c95cf0e10cd05c1c4ce9dd35c9fc64c331 (diff)
parent30d4618cc944a41c2ca202babd0be0da4a1cd9d2 (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/main.cc10
-rw-r--r--src/nix/progress-bar.cc6
-rw-r--r--src/nix/run.cc4
-rw-r--r--src/nix/upgrade-nix.cc6
4 files changed, 13 insertions, 13 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc
index c5ca089ee..15f412dae 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -8,7 +8,7 @@
#include "shared.hh"
#include "store-api.hh"
#include "progress-bar.hh"
-#include "download.hh"
+#include "filetransfer.hh"
#include "finally.hh"
#include <sys/types.h>
@@ -177,10 +177,10 @@ void mainWrapped(int argc, char * * argv)
settings.useSubstitutes = false;
if (!settings.tarballTtl.overriden)
settings.tarballTtl = std::numeric_limits<unsigned int>::max();
- if (!downloadSettings.tries.overriden)
- downloadSettings.tries = 0;
- if (!downloadSettings.connectTimeout.overriden)
- downloadSettings.connectTimeout = 1;
+ if (!fileTransferSettings.tries.overriden)
+ fileTransferSettings.tries = 0;
+ if (!fileTransferSettings.connectTimeout.overriden)
+ fileTransferSettings.connectTimeout = 1;
}
if (args.refresh)
diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc
index 26631416c..adc9b9a5d 100644
--- a/src/nix/progress-bar.cc
+++ b/src/nix/progress-bar.cc
@@ -190,8 +190,8 @@ public:
i->s = fmt("querying " ANSI_BOLD "%s" ANSI_NORMAL " on %s", name, getS(fields, 1));
}
- if ((type == actDownload && hasAncestor(*state, actCopyPath, parent))
- || (type == actDownload && hasAncestor(*state, actQueryPathInfo, parent))
+ if ((type == actFileTransfer && hasAncestor(*state, actCopyPath, parent))
+ || (type == actFileTransfer && hasAncestor(*state, actQueryPathInfo, parent))
|| (type == actCopyPath && hasAncestor(*state, actSubstitute, parent)))
i->visible = false;
@@ -416,7 +416,7 @@ public:
if (!s2.empty()) { res += " ("; res += s2; res += ')'; }
}
- showActivity(actDownload, "%s MiB DL", "%.1f", MiB);
+ showActivity(actFileTransfer, "%s MiB DL", "%.1f", MiB);
{
auto s = renderActivity(actOptimiseStore, "%s paths optimised");
diff --git a/src/nix/run.cc b/src/nix/run.cc
index 7fd9c4c7e..901b87fbb 100644
--- a/src/nix/run.cc
+++ b/src/nix/run.cc
@@ -59,14 +59,14 @@ struct RunCommon : virtual Command
struct CmdRun : InstallablesCommand, RunCommon, MixEnvironment
{
- std::vector<std::string> command = { "bash" };
+ std::vector<std::string> command = { getEnv("SHELL").value_or("bash") };
CmdRun()
{
mkFlag()
.longName("command")
.shortName('c')
- .description("command and arguments to be executed; defaults to 'bash'")
+ .description("command and arguments to be executed; defaults to '$SHELL'")
.labels({"command", "args"})
.arity(ArityAny)
.handler([&](std::vector<std::string> ss) {
diff --git a/src/nix/upgrade-nix.cc b/src/nix/upgrade-nix.cc
index c05c29517..4fcc6a721 100644
--- a/src/nix/upgrade-nix.cc
+++ b/src/nix/upgrade-nix.cc
@@ -1,7 +1,7 @@
#include "command.hh"
#include "common-args.hh"
#include "store-api.hh"
-#include "download.hh"
+#include "filetransfer.hh"
#include "eval.hh"
#include "attr-path.hh"
#include "names.hh"
@@ -138,8 +138,8 @@ struct CmdUpgradeNix : MixDryRun, StoreCommand
Activity act(*logger, lvlInfo, actUnknown, "querying latest Nix version");
// FIXME: use nixos.org?
- auto req = DownloadRequest(storePathsUrl);
- auto res = getDownloader()->download(req);
+ auto req = FileTransferRequest(storePathsUrl);
+ auto res = getFileTransfer()->download(req);
auto state = std::make_unique<EvalState>(Strings(), store);
auto v = state->allocValue();