How to search in nixpkgs extended with overlay

Is there any way to search in nixpkgs instance extended with overlay ?

Something like this (which doesn’t work):

nix search --impure --expr "let p = import <nixpkgs> { overlays = [ myoverlyay ]}; in p"" package

Thanks.

I also wrote nix code to list all packages which could be adapted to filter by some string, but unfortunately it doesn’t work:

# list-packages.nix

let
  overlay = (builtins.getFlake "github:imincik/geospatial-nix-rolling").overlays.geonix;
  pkgs = import <nixpkgs> { overlays = [ overlay ]; };
  pkgs' = pkgs.lib.filterAttrs (_: value: pkgs.lib.isDerivation value) pkgs;
in
pkgs.lib.mapAttrs (key: value: "${key}: ${toString value.version}") pkgs'

$ nix eval -f ./list-packages.nix

error:
       … while evaluating the file '/home/imincik/Projects/geonix-env/code/list-pkgs.nix':

       … while calling the 'mapAttrs' builtin

         at /home/imincik/Projects/geonix-env/code/list-pkgs.nix:12:1:

           11| # pkgs.lib.mapAttrs (key: value: "${key}: ${if (builtins.tryEval value) then (toString value.version) else "xxxx"}") pkgs''
           12| pkgs.lib.mapAttrs (key: value: "${key}: ${toString value.version}") pkgs'
             | ^
           13|

       … while calling the 'listToAttrs' builtin

         at /nix/store/6viki0xn0rpxw1spfn1kp1ii2s19v75x-source/lib/attrsets.nix:382:5:

          381|     set:
          382|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |     ^
          383|

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: Please be informed that this pseudo-package is not the only part of
       Nixpkgs that fails to evaluate. You should not evaluate entire Nixpkgs
       without some special measures to handle failing packages, like those taken
       by Hydra.