You are importing <nixpkgs> (which does a lookup in NIX_PATH and is completely independent from the nixpkgs variable in scope) instead of plain nixpkgs.
There seems to have been a recent thread on the topic of legacyPackages/import:
You are importing <nixpkgs> (which does a lookup in NIX_PATH and is completely independent from the nixpkgs variable in scope) instead of plain nixpkgs.
There seems to have been a recent thread on the topic of legacyPackages/import: