Replace installed_derivations cache with perl hackery