anchor.diff:      # ExecStart can't be overwritten in overrides.
       # We need that to use wrapped executable and correct config file.
       sed '/^ExecStart=/d' -i systemd/kresd@.service.in
  +  ''
  +    # some tests have issues with network sandboxing, apparently
  +  + optionalString doInstallCheck ''
  +    echo 'os.exit(77)' > daemon/lua/trust_anchors.test/bootstrap.test.lua
  +    sed '/^[[:blank:]]*test_dstaddr,$/d' -i tests/config/doh2.test.lua
     '';
   
     preConfigure = ''
  
positive.code: 
  result = if extraFeatures then wrapped-full else unwrapped;
  
  inherit (stdenv.lib) optional optionals;
  lua = luajitPackages;
  
  unwrapped = stdenv.mkDerivation rec {
  
negative.code:   # http://knot-resolver.readthedocs.io/en/latest/build.html#requirements
    buildInputs = [ knot-dns lua.lua libuv gnutls lmdb ]
      ++ optional stdenv.isLinux systemd # passing sockets, sd_notify
      ++ [ nghttp2 ]
      ## optional dependencies; TODO: libedit, dnstap
      ;
  
  