16extern std::string programPath;
18extern char * * savedArgv;
24static constexpr Command::Category catHelp = -1;
25static constexpr Command::Category catSecondary = 100;
26static constexpr Command::Category catUtility = 101;
27static constexpr Command::Category catNixInstallation = 102;
29static constexpr auto installablesCategory =
"Options that change the interpretation of [installables](@docroot@/command-ref/new-cli/nix.md#installables)";
32#pragma GCC diagnostic ignored "-Woverloaded-virtual"
49 std::shared_ptr<Store> _store;
58 std::string srcUri, dstUri;
72 bool startReplOnEvalErrors =
false;
73 bool ignoreExceptionsDuringTry =
false;
84 std::shared_ptr<Store> evalStore;
86 std::shared_ptr<eval_cache::CachingEvaluator> evalState;
113 std::optional<Path> file;
114 std::optional<std::string> expr;
126 virtual Strings getDefaultFlakeAttrPaths();
128 virtual Strings getDefaultFlakeAttrPathPrefixes();
163 virtual void run(
ref<Store> store, std::vector<std::string> && rawInstallables) = 0;
168 virtual void applyDefaultInstallables(std::vector<std::string> & rawInstallables);
170 bool readFromStdIn =
false;
176 std::vector<std::string> rawInstallables;
187 void run(
ref<Store> store, std::vector<std::string> && rawInstallables)
override;
205 std::string _installable{
"."};
225 bool recursive =
false;
230 Realise realiseMode = Realise::Derivation;
240 void applyDefaultInstallables(std::vector<std::string> & rawInstallables)
override;
247 virtual void run(
ref<Store> store, StorePaths && storePaths) = 0;
259 void run(
ref<Store> store, StorePaths && storePaths)
override;
267 using CommandMap = std::map<
268 std::vector<std::string>,
271 static CommandMap * commands;
273 static void add(std::vector<std::string> && name,
277 commands =
new CommandMap;
279 commands->emplace(name, command);
282 static nix::CommandMap getCommandsFor(
const std::vector<std::string> & prefix);
285template<
typename Base>
292 template<
typename...
Args>
294 : Base(std::forward<Args>(args)...)
306static void registerCommand(
const std::string & name)
308 CommandRegistry::add({name}, [](AsyncIoRoot & aio) {
309 return make_ref<MixAio<T>>(aio);
314static void registerCommand2(std::vector<std::string> && name)
316 CommandRegistry::add(std::move(name), [](AsyncIoRoot & aio) {
317 return make_ref<MixAio<T>>(aio);
323 std::optional<Path> profile;
328 void updateProfile(
const StorePath & storePath);
332 void updateProfile(
const BuiltPaths & buildables);
342 StringSet keep, unset;
344 std::vector<char*> vectorEnv;
345 bool ignoreEnvironment;
357void completeFlakeInputPath(
360 const std::vector<FlakeRef> & flakeRefs,
361 std::string_view prefix);
363void completeFlakeRef(
367void completeFlakeRefWithFragment(
372 Strings attrPathPrefixes,
373 const Strings & defaultFlakeAttrPaths,
374 std::string_view prefix);
376kj::Promise<Result<void>> printClosureDiff(
381 std::string_view indent);
std::function< CompleterFun > CompleterClosure
Definition args.hh:151
Definition command.hh:287
OperateOn
Definition installables.hh:45
Realise
Definition installables.hh:18
std::vector< ref< Installable > > Installables
Definition installables.hh:102
Definition command.hh:222
Definition command.hh:266
Definition command.hh:194
std::vector< FlakeRef > getFlakeRefsForCompletion() override
Definition installables.cc:847
Definition command.hh:184
Definition command.hh:336
Definition command.hh:340
Definition common-eval-args.hh:18
virtual std::vector< FlakeRef > getFlakeRefsForCompletion()
Definition command.hh:107
Definition command.hh:209
Definition command.hh:322
Definition command.hh:149
Definition command.hh:160
std::vector< FlakeRef > getFlakeRefsForCompletion() override
Definition installables.cc:823
Definition command.hh:112
CompleterClosure getCompleteInstallable()
Definition installables.cc:203
void completeInstallable(EvalState &state, AddCompletions &completions, std::string_view prefix)
Definition installables.cc:210
virtual void run(ref< Store >)=0
void run() override
Definition command.cc:53
Definition command.hh:256
Definition command.hh:244