Four Takes on Hanukah

ת"ר לפי שראה אדם הראשון יום שמתמעט והולך אמר אוי לי שמא בשביל שסרחתי עולם חשוך בעדי וחוזר לתוהו ובוהו וזו היא מיתה שנקנסה עלי מן השמים עמד וישב ח' ימים בתענית [ובתפלה] כיון שראה תקופת טבת וראה יום שמאריך והולך אמר מנהגו של עולם הוא הלך ועשה שמונה ימים טובים לשנה האחרת עשאן לאלו ולאלו ימים טובים הוא קבעם לשם שמים והם קבעום לשם עבודת כוכבים

Our sages taught: When Adam saw that the days were getting shorter, he said: "Oy, I did the wrong thing and therefore the World is getting darker and is returning to chaos. Death has been decreed upon me!" Adam, therefore, spent 8 days fasting and praying. As he finished his fast, Adam saw that the days were getting longer. He understood that the progressive decrease or increase in daylight was how the World worked. Thus, in the following year, he made the celebrated the end of the shorting days with 8 days of celebration. Adam set this holiday to worship God.

מאי חנוכה דתנו רבנן בכ"ה בכסליו יומי דחנוכה תמניא אינון דלא למספד בהון ודלא להתענות בהון שכשנכנסו יוונים להיכל טמאו כל השמנים שבהיכל וכשגברה מלכות בית חשמונאי ונצחום בדקו ולא מצאו אלא פך אחד של שמן שהיה מונח בחותמו של כהן גדול ולא היה בו אלא להדליק יום אחד נעשה בו נס והדליקו ממנו שמונה ימים לשנה אחרת קבעום ועשאום ימים טובים בהלל והודאה

What is Chanukah? that our Sages taught: On the 25th of Kislev - the days of Chanukah, they are eight, not to eulogize on them and not to fast on them? When the Greeks entered the Temple, they polluted all the oils in the Temple, and when the Hasmonean dynasty overcame and defeated them, they checked and they found but one cruse of oil that was set in place with the seal of the High Priest, but there was in it only [enough] to light a single day. A miracle was done with it, and it stayed lit for eight days. The following year [the Sages] fixed those [days], making them holidays for praise and thanksgiving.

The texts from Shabbat and Avodah Zarah are both Talmudic which was sealed over 1500 years ago.

The current text of Al HaNissim is taken from the siddur of Rav Amram Gaon (Seder Hanukkah). He died in 875; and Siddur R. Sa’adyah Gaon (He died in 942).

על הניסים (מסידור התפילה)

על הניסים ועל הפורקן ועל הגבורות ועל התשועות ועל המלחמות שעשית לאבותינו בימים ההם בזמן הזה. בימי מתיתיהו בן יוחנן, כהן גדול, חשמונאי, כשעמדה מלכות יוון הרשעה על עמך ישראל להשכיחם תורתך ולהעבירם מחוקי רצונך. ואתה, ברחמך הרבים, עמדת להם בעת צרתם, רבת את ריבם, דנת את דינם, נקמת את נקמתם. מסרת גיבורים ביד חלשים ורבים ביד מעטים וטמעים ביד טהורים ורשעים ביד צדיקים וזדים ביד עוסקי תורתך ולך עשית שם גדול וקדוש בעולמך ולעמך ישראל עשית תשועה גדולה ופורקן כהיום הזה ואחר כן באו בניך לדביר ביתך ופניו את היכלך וטיהרו את מקדשיך והדליקו נרות בחצרות קודשך וקבעו שמונת ימי חנוכה אלו להודות ולהלל לשמך הגדול

Al Hanisim (from the Siddur)

"We thank You also for the miraculous deeds and for the redemption and for the mighty deeds and the saving acts wrought by You, as well as for the wars which You waged for our ancestors in ancient days at this season. In the days of the Hasmonean Mattathias, son of Johanan the high priest, and his sons, when the iniquitous Greco-Syrian kingdom rose up against Your people Israel, to make them forget Your Torah and to turn them away from the ordinances of Your will, then You in your abundant mercy rose up for them in the time of their trouble, pled their cause, executed judgment, avenged their wrong, and delivered the strong into the hands of the weak, the many into the hands of few, the impure into the hands of the pure, the wicked into the hands of the righteous, and insolent ones into the hands of those occupied with Your Torah. Both unto Yourself did you make a great and holy name in Thy world, and unto Your people did You achieve a great deliverance and redemption. Whereupon your children entered the sanctuary of Your house, cleansed Your temple, purified Your sanctuary, kindled lights in Your holy courts, and appointed these eight days of Hanukkah in order to give thanks and praises unto Your holy name."

HaNerot Hallalu appears in Masekhet Sofrim, in the 8th century.

(א) הַנֵּרוֹת הַלָּלוּ שֶׁאָנוּ מַדְלִיקִין, עַל הַנִּסִּים וְעַל הַנִּפְלָאוֹת וְעַל הַתְּשׁוּעוֹת וְעַל הַמִּלְחָמוֹת, שֶׁעָשִׂיתָ לַאֲבוֹתֵינוּ בַּיָּמִים הָהֵם בַּזְּמַן הַזֶּה, עַל יְדֵי כֹּהֲנֶיךָ הַקְּדוֹשִׁים. וְכָל שְׁמוֹנַת יְמֵי הַחֲנֻכָּה הַנֵּרוֹת הַלָּלוּ קֹדֶשׁ הֵם וְאֵין לָנוּ רְשׁוּת לְהִשְׁתַּמֵּשׁ בָּהֶם, אֶלָּא לִרְאוֹתָם בִּלְבָד, כְּדֵי לְהוֹדוֹת וּלְהַלֵּל לְשִׁמְךָ הַגָּדוֹל עַל נִסֶּיךָ וְעַל נִפְלְאוֹתֶיךָ וְעַל יְשׁוּעָתֶךָ.

(1) We kindle these lights on account of the miracles, the deliverances and the wonders which You did for our ancestors, by means of thy holy priests. During all the eight days of Chanukah these lights are sacred, thus it is not permitted us to make any profane use of them; but we are only to look at them, in order that we may give thanks unto Your name for the miracles you preformed and the deliverances and wonders You gave to us.