1 #include "config.hh"
2 #include "primops.hh"
3
4 using namespace nix;
5
6 struct MySettings : Config
7 {
8 Setting<bool> settingSet{this, false, "setting-set",
9 "Whether the plugin-defined setting was set"};
10 };
11
12 MySettings mySettings;
13
14 static GlobalConfig::Register rs(&mySettings);
15
prim_anotherNull(EvalState & state,const Pos & pos,Value ** args,Value & v)16 static void prim_anotherNull (EvalState & state, const Pos & pos, Value ** args, Value & v)
17 {
18 if (mySettings.settingSet)
19 mkNull(v);
20 else
21 mkBool(v, false);
22 }
23
24 static RegisterPrimOp rp("anotherNull", 0, prim_anotherNull);
25