First of all, there is a distinction between being impeached and being convicted. Trump was impeached when the House voted to adopt an Article of Impeachment. That happened while he was still in office. He will not be convicted until the Senate votes to convict him by a 2/3rds vote, if it ever does.
In the case of Nixon, the House had not yet voted to adopt Articles of Impeachment when he resigned. They had been introduced and debated, but not yet finally approved.
Moreover, we don't know what would have happened if the House had proceeded to pass such articles after Nixon had resigned. The House of that time did not choose to proceed. There was no court ruling saying that they could not do so.
There are some precedents saying that the Senate can proceed with a trial after an official resigns or is expelled after impeachment. None of these are at all recent, none are clear cut, none involved an official whose term had ended, none involved a President, and none that I am aware of led to a conviction. And this issue has never been tested in a Federal court.
Specifically, there is the case of William Belknap. Belknap was Secretary of War under US President Grant. He was accused of improperly profiting from military contracts. The House started impeachment proceedings. Grant interviewed Belknap, who confessed to Grant and resigned on the spot. The house none the less pass five articles of impeachment after Belknap resigned. When the Senate took up the case, there was a motion to dismiss on the ground that the Senate did not have jurisdiction because of Belknap's resignation. By a vote of 37–29 the Senate held that it had jurisdiction and that a trial should proceed. The vote to convict Belknap was 35 for conviction, 25 against it. This was five votes short of the required 2/3rds to convict. Most of the Senators voting against conviction were on record as doing so because they did not agree that the Senate had jurisdiction. Thus a majority vote of the Senate held in that case that such a trial was proper, but less than 2/3rds. (Most also indicted that they thought the charges true.)
There was also the case of William Blount. Blount, a Senator, was impeached by the House in 1798. (In fact this was the first impeachment ever under the US Constitution.) The Senate voted to expel him. When the articles of impeachment came up in 1799, the Senate voted to dismiss the impeachment, on the ground that the impeachment process did not extend to members of the Senate, but not on the grounds that the expulsion rendered the proceedings moot.
Should Trump be convicted by the Senate (which now seems unlikely) he might bring a court case claiming that such a conviction was unconstitutional. There is no knowing how a court would handle such a case. And if Trump is not convicted, no such case will be brought this time, either.
This Washington Post opinion piece by two Constitutional scholars claims that such a trial would be constitutionally proper. It also claims that it would not have been proper had the vote to adopt articles of impeachment occurred after Trump had left office. Others have taken different positions. Whether a Senate trial of an impeachment is constitutional after the person impeached has left office is a hotly debated question at the moment. There has never been a court ruling on the point, and neither of the precedents is of a situation quite matching the current impeachment of Trump.
No court has ruled on the matter. The Senate did not vote for a motion to dismiss the impeachment on those grounds, although if every senator who voted for the motion voted to acquit, Trump would not be convicted.
From the comments
I wish that any downvoters would leave a comment indicting what thy think is wring with this answer. In the absence of a comment, I cannot improve the answer, others cannot use the reasons to write better answers, and readers have no idea why someone objects to the answer. Such a downvote seems pointless.
I have updated this answer with a discussion of the Blount and Belknap precedents. In neither case did the Senate actually vote to dismiss the articles because the accused was no longer in office, although that seems to be a major reason why 25 senators voted against convicting Belknap.