mirror of
https://github.com/NixOS/nix.git
synced 2025-12-16 22:11:05 +01:00
Move /src to /subprojects
This will facilitate breaking up Nix into multiple packages for each component with Meson.
This commit is contained in:
parent
4db9487823
commit
84e2963f8e
737 changed files with 504 additions and 505 deletions
73
subprojects/libcmd/common-eval-args.hh
Normal file
73
subprojects/libcmd/common-eval-args.hh
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "args.hh"
|
||||
#include "canon-path.hh"
|
||||
#include "common-args.hh"
|
||||
#include "search-path.hh"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
namespace nix {
|
||||
|
||||
class Store;
|
||||
|
||||
namespace fetchers { struct Settings; }
|
||||
|
||||
class EvalState;
|
||||
struct EvalSettings;
|
||||
struct CompatibilitySettings;
|
||||
class Bindings;
|
||||
struct SourcePath;
|
||||
|
||||
namespace flake { struct Settings; }
|
||||
|
||||
/**
|
||||
* @todo Get rid of global setttings variables
|
||||
*/
|
||||
extern fetchers::Settings fetchSettings;
|
||||
|
||||
/**
|
||||
* @todo Get rid of global setttings variables
|
||||
*/
|
||||
extern EvalSettings evalSettings;
|
||||
|
||||
/**
|
||||
* @todo Get rid of global setttings variables
|
||||
*/
|
||||
extern flake::Settings flakeSettings;
|
||||
|
||||
/**
|
||||
* Settings that control behaviors that have changed since Nix 2.3.
|
||||
*/
|
||||
extern CompatibilitySettings compatibilitySettings;
|
||||
|
||||
struct MixEvalArgs : virtual Args, virtual MixRepair
|
||||
{
|
||||
static constexpr auto category = "Common evaluation options";
|
||||
|
||||
MixEvalArgs();
|
||||
|
||||
Bindings * getAutoArgs(EvalState & state);
|
||||
|
||||
LookupPath lookupPath;
|
||||
|
||||
std::optional<std::string> evalStoreUrl;
|
||||
|
||||
private:
|
||||
struct AutoArgExpr { std::string expr; };
|
||||
struct AutoArgString { std::string s; };
|
||||
struct AutoArgFile { std::filesystem::path path; };
|
||||
struct AutoArgStdin { };
|
||||
|
||||
using AutoArg = std::variant<AutoArgExpr, AutoArgString, AutoArgFile, AutoArgStdin>;
|
||||
|
||||
std::map<std::string, AutoArg> autoArgs;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param baseDir Optional [base directory](https://nixos.org/manual/nix/unstable/glossary#gloss-base-directory)
|
||||
*/
|
||||
SourcePath lookupFileArg(EvalState & state, std::string_view s, const Path * baseDir = nullptr);
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue