"The option `checks' does not exist." when switching to NixOS 23.05

I am trying to switch to NixOS 23.05. I have been using flakes for my system configuration for a long time, but with the new nixpkgs the following error pops:

$ nix flake check #herberteuler
warning: Git tree '/home/xgp/sys/mynix' is dirty
error: The option `checks' does not exist. Definition values:
       - In `/nix/store/nvzp1fq9ngc7drjxdk69vckv6a3bdzl5-source/flake.nix':
             x86_64-linux = {
               tarball = <derivation nixpkgs-tarball-23.05pre20230930.15c4fb6>;
(use '--show-trace' to show detailed location information)

The related line of code is this one, but it already existed in the previous release.

What could be the reason of the error and how should I resolve it?


Could you show your flake.nix?

It is not a simple flake.nix, but a rather complex hierarchical structure instead.
However, I have managed to resolve it. It was because I had a custom module named nixpkgs, which shadowed the real nixpkgs.