Allow plugins to define new settings.
This commit is contained in:
parent
3fe9767dd3
commit
de4934ab3b
8 changed files with 65 additions and 32 deletions
|
@ -1,10 +1,19 @@
|
|||
#include "globals.hh"
|
||||
#include "primops.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
static BaseSetting<bool> settingSet{false, "setting-set",
|
||||
"Whether the plugin-defined setting was set"};
|
||||
|
||||
static RegisterSetting rs(&settingSet);
|
||||
|
||||
static void prim_anotherNull (EvalState & state, const Pos & pos, Value ** args, Value & v)
|
||||
{
|
||||
mkNull(v);
|
||||
if (settingSet)
|
||||
mkNull(v);
|
||||
else
|
||||
mkBool(v, false);
|
||||
}
|
||||
|
||||
static RegisterPrimOp r("anotherNull", 0, prim_anotherNull);
|
||||
static RegisterPrimOp rp("anotherNull", 0, prim_anotherNull);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue