mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-30 01:26:15 +02:00
24 lines
527 B
C++
24 lines
527 B
C++
#include "config.hh"
|
|
#include "primops.hh"
|
|
|
|
using namespace nix;
|
|
|
|
struct MySettings : Config
|
|
{
|
|
Setting<bool> settingSet{this, false, "setting-set",
|
|
"Whether the plugin-defined setting was set"};
|
|
};
|
|
|
|
MySettings mySettings;
|
|
|
|
static GlobalConfig::Register rs(&mySettings);
|
|
|
|
static void prim_anotherNull (EvalState & state, const Pos & pos, Value ** args, Value & v)
|
|
{
|
|
if (mySettings.settingSet)
|
|
v.mkNull();
|
|
else
|
|
v.mkBool(false);
|
|
}
|
|
|
|
static RegisterPrimOp rp("anotherNull", 0, prim_anotherNull);
|