@@ -847,13 +847,22 @@ self: {
847847 ];
848848 executableToolDepends = [ emacs ];
849849 postInstall = ''
850− $out/bin/agda -c --no-main $(find $out/share -name Primitive.agda)
850+ # Separate loops to avoid internal error
851+ files=($out/share/*-ghc-*/Agda-*/lib/prim/Agda/{Primitive.agda,Builtin/*.agda})
852+ for f in "''${files[@]}"
853+ do
854+ $out/bin/agda $f
855+ done
856+ for f in "''${files[@]}"
857+ do
858+ $out/bin/agda -c --no-main $f
859+ done
851860 $out/bin/agda-mode compile
852861 '';
853862 homepage = "http://wiki.portal.chalmers.se/agda/";
854863 description = "A dependently typed functional programming language and proof assistant";
855864 license = "unknown";
856− maintainers = with stdenv.lib.maintainers; [ abbradar ];
865+ maintainers = with stdenv.lib.maintainers; [ abbradar mudri ];
857866 }) {inherit (pkgs) emacs;};
858867
859868 "Agda-executable" = callPackage