nixd
Loading...
Searching...
No Matches
Controller/Configuration.h
Go to the documentation of this file.
1/// \file
2/// \brief Declares workspace configuration schema
3#pragma once
4
5#include <llvm/Support/JSON.h>
6
7#include <map>
8#include <string>
9#include <vector>
10
11namespace nixd {
12
13// NOLINTBEGIN(readability-identifier-naming)
15 struct Formatting {
16 std::vector<std::string> command = {"nixfmt"};
18
20 /// \brief Expression to eval. Select this attrset as eval .options
21 std::string expr;
22 };
23
24 std::map<std::string, OptionProvider> options;
25
27 /// \brief Expression to eval. Treat it as "import <nixpkgs> { }"
28 std::string expr;
30
31 struct Diagnostic {
32 std::vector<std::string> suppress;
34};
35
36bool fromJSON(const llvm::json::Value &Params, Configuration::Diagnostic &R,
37 llvm::json::Path P);
38
39bool fromJSON(const llvm::json::Value &Params, Configuration::Formatting &R,
40 llvm::json::Path P);
41
42bool fromJSON(const llvm::json::Value &Params, Configuration::OptionProvider &R,
43 llvm::json::Path P);
44
45bool fromJSON(const llvm::json::Value &Params,
46 Configuration::NixpkgsProvider &R, llvm::json::Path P);
47
48bool fromJSON(const llvm::json::Value &Params, Configuration &R,
49 llvm::json::Path P);
50
51// NOLINTEND(readability-identifier-naming)
52
53} // namespace nixd
bool fromJSON(const llvm::json::Value &Params, Configuration::Diagnostic &R, llvm::json::Path P)
std::string expr
Expression to eval. Treat it as "import <nixpkgs> { }".
std::string expr
Expression to eval. Select this attrset as eval .options.
struct nixd::Configuration::Formatting formatting
std::map< std::string, OptionProvider > options
struct nixd::Configuration::Diagnostic diagnostic
struct nixd::Configuration::NixpkgsProvider nixpkgs