(A) ハワイからおみやげにマカダミア•ナッツを買って来る
I'll buy you guys a gift of macadamia nuts in Hawaii
(B) ハワイからマカダミア•ナッツのおみやげを買って来る
I suppose に here indicates the purpose of the action like in the following:
あなたはテレビゲームにお金を使いすぎます
If that's the case, would B sound unnatural because the noun modifier is too long?
From the same book, の is being used instead in another example, but the noun modifier is shorter:
田中さんのうちへ行く時、チーズのおみやげを持って行こう。