anchor.diff:  , propagatedNativeBuildInputs ? []
   
   # used to disable derivation, useful for specific lua versions
  +# TODO move from this setting meta.broken to a 'disabled' attribute on the
  +# package, then use that to skip/include in each lua${ver}Packages set?
   , disabled ? false
   
   # Additional arguments to pass to the makeWrapper function, which wraps
   # generated binaries.
   , makeWrapperArgs ? []
  -, external_deps ? propagatedBuildInputs ++ buildInputs
   
   # Skip wrapping of lua programs altogether
   , dontWrapLuaPrograms ? false
  
positive.code: 
      nix_debug "ROCKSPEC $rockspecFilename"
      nix_debug "cwd: $PWD"
      $LUAROCKS make --deps-mode=none --tree $out ''${rockspecFilename}
  
      # to prevent collisions when creating environments
      # also added -f as it doesn't always exist
      # don't remove the whole directory as
      rm -rf $out/lib/luarocks/rocks-${lua.luaversion}/manifest
  
      runHook postInstall
    '';
  
    passthru = {
      inherit lua; # The lua interpreter
    } // passthru;
  
    meta = with lib.maintainers; {
      platforms = lua.meta.platforms;
      # add extra maintainer(s) to every package
      maintainers = (meta.maintainers or []) ++ [ ];
    } // meta;
  }))
  
negative.code: , passthru ? {}
  , doCheck ? false
  
  # Non-Lua / system (e.g. C library) dependencies. Is a list of deps, where
  # each dep is either a derivation, or an attribute set like
  # { name = "rockspec external_dependencies key"; dep = derivation; }
  # The latter is used to work-around luarocks having a problem with
  # multiple-output derivations as external deps:
  # https://github.com/luarocks/luarocks/issues/766<Paste>
  , externalDeps ? lib.unique (lib.filter (drv: !drv ? luaModule) (propagatedBuildInputs ++ buildInputs))
  
  # Appended to the generated luarocks config
  , extraConfig ? ""
  # Inserted into the generated luarocks config in the "variables" table
  , extraVariables ? ""
  # The two above arguments have access to builder variables -- e.g. to $out
  
  # relative to srcRoot, path to the rockspec to use when using rocks
  , rockspecFilename ?  "../*.rockspec"
  