anchor.diff: -{lib, stdenv, fetchFromGitHub, buildPackages
  +{ lib
  +, stdenv
  +, fetchFromGitHub
   , fetchpatch
  -, curl, makeWrapper, which, unzip
  +, curl
  +, makeWrapper
  +, which
  +, unzip
   , lua
  -# for 'luarocks pack'
  +, file
  +, nix-prefetch-git
  +  # for 'luarocks pack'
   , zip
   , nix-update-script
  -# some packages need to be compiled with cmake
  +  # some packages need to be compiled with cmake
   , cmake
   , installShellFiles
   }:
   
  -stdenv.mkDerivation rec {
  +stdenv.mkDerivation (self: {
     pname = "luarocks";
     version = "3.9.1";
   
     src = fetchFromGitHub {
       owner = "luarocks";
       repo = "luarocks";
  -    rev = "v${version}";
  +    rev = "v${self.version}";
       sha256 = "sha256-G6HDap3pspeQtGDBq+ukN7kftDaT/CozMVdYM60F6HI=";
     };
   
  
positive.code:               --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?.lua" \
                --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?/init.lua" \
                --suffix LUA_CPATH ";" "$(echo "$out"/lib/lua/*/)?.so" \
                --suffix LUA_CPATH ";" "$(echo "$out"/share/lua/*/)?/init.lua"
          }
      done
    '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
      installShellCompletion --cmd luarocks --bash <($out/bin/luarocks completion bash)
      installShellCompletion --cmd luarocks --zsh <($out/bin/luarocks completion zsh)
    '';
  
    propagatedBuildInputs = [ zip unzip cmake ];
  
negative.code: 
    passthru = {
      updateScript = nix-update-script {
        attrPath = self.pname;
      };
    };
  
    meta = with lib; {
      description = "A package manager for Lua";
      license = licenses.mit;
      maintainers = with maintainers; [ raskin teto ];
      platforms = platforms.linux ++ platforms.darwin;
      downloadPage = "http://luarocks.org/releases/";
    };
  })
  