anchor.diff:  
     preConfigure = ''
       patchShebangs scripts/
  -  ''
  -    + stdenv.lib.optionalString doInstallCheck (exportLuaPathsFor [ lua.cqueues lua.basexx ]);
  +  '';
   
     nativeBuildInputs = [ pkgconfig meson ninja ];
   
  
positive.code:     echo "Checking that 'http' module loads, i.e. lua search paths work:"
      echo "modules.load('http')" > test-http.lua
      echo -e 'quit()' | env -i "$out"/bin/kresd -a 127.0.0.1#53535 -c test-http.lua
    '');
  
  in result
  
negative.code:   };
  };
  
  wrapped-full = runCommand unwrapped.name
    {
      nativeBuildInputs = [ makeWrapper ];
      buildInputs = with luajitPackages; [
        luasec luasocket # trust anchor bootstrap, prefill module
        luafilesystem # prefill module
        http # for http module; brings lots of deps; some are useful elsewhere
      ];
      preferLocalBuild = true;
      allowSubstitutes = false;
    }
    ''
      mkdir -p "$out"/{bin,share}
      makeWrapper '${unwrapped}/bin/kresd' "$out"/bin/kresd \
        --set LUA_PATH  "$LUA_PATH" \
  