It's up to each state to determine how it will award electoral votes to candidates.
Not quite. Even the practice of allotting electoral votes based upon Congressional districts would be suspect in many states. Maine and Nebraska can get away with it because the states have distinct parts, and nobody is splitting up the state to splinter the urban vote to dilute it with rural areas. Let us remember that people rarely know where the boundaries of Congressional districts are. County lines are well established almost everywhere, and you will see signs identifying township lines on major highways. Congressional districts can change every ten years due to reapportionment. People from outside Michigan would never know the division between the 6th and 7th Congressional districts by reading a road sign separating the districts.
Allotting all electoral votes by winner-take-all has been the norm since before the Civil War, so it has been done. If states deem that they will allot their votes in accordance with the national popular vote, that seems to be legal even if such has not yet been done.
Some methods would be unacceptable. The decision of a Governor or the vote of a state legislature would surely not pass Constitutional muster.