Skip to content

Commit d3ff470

Browse files
committed
Move fetchSettings back to libfetchers
This is needed for builtin:fetch-tree to get access to it.
1 parent 464f408 commit d3ff470

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

src/libcmd/common-eval-args.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ namespace nix {
2020

2121
namespace fs { using namespace std::filesystem; }
2222

23-
fetchers::Settings fetchSettings;
24-
25-
static GlobalConfig::Register rFetchSettings(&fetchSettings);
26-
2723
EvalSettings evalSettings {
2824
settings.readOnlyMode,
2925
{

src/libcmd/include/nix/cmd/common-eval-args.hh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ struct SourcePath;
2222

2323
namespace flake { struct Settings; }
2424

25-
/**
26-
* @todo Get rid of global setttings variables
27-
*/
2825
extern fetchers::Settings fetchSettings;
2926

3027
/**

src/libfetchers/fetch-settings.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "nix/fetchers/fetch-settings.hh"
2+
#include "nix/util/config-global.hh"
23

34
namespace nix::fetchers {
45

@@ -7,3 +8,11 @@ Settings::Settings()
78
}
89

910
}
11+
12+
namespace nix {
13+
14+
fetchers::Settings fetchSettings;
15+
16+
static GlobalConfig::Register rFetchSettings(&fetchSettings);
17+
18+
}

src/libfetchers/include/nix/fetchers/fetch-settings.hh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,12 @@ struct Settings : public Config
109109
};
110110

111111
}
112+
113+
namespace nix {
114+
115+
/**
116+
* @todo Get rid of global setttings variables
117+
*/
118+
extern fetchers::Settings fetchSettings;
119+
120+
}

0 commit comments

Comments
 (0)