Struggling to set up a Qt devshell

This was a stupid mistake on my part. I should’ve been using cmake. (I assumed that qmake used cmake internally…). Part of learning, right?

Anyways, for future reference, this flake creates an appropriate shell:

{

    inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=25.11";

    outputs = { self, nixpkgs }:
    let
        pkgs = import nixpkgs { system = "x86_64-linux"; };
        qtEnv = with pkgs.qt6; env "qt-custom-${qtbase.version}" [
            qtdeclarative
            qtbase
            qttools
            wrapQtAppsHook
        ];
    in
    {

        devShells.x86_64-linux.default = pkgs.mkShell {
            buildInputs = [
                pkgs.cmake
                qtEnv
                pkgs.libglvnd
            ];
            shellHook = ''
                echo entered dev shell
            '';
        };
    };

}

cmake finds the appropriate libraries in that shell.

EDIT:
I was having trouble getting the built executable to load the Wayland plugin, so I forwent the strange qtEnv expression I got from the wiki. I didn’t want to follow the Nix package approach since I’m using this to learn, not just to make a working package. This is my new flake:

{

    inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=25.11";

    outputs = { self, nixpkgs }:
    let
        pkgs = import nixpkgs { system = "x86_64-linux"; };
    in
    {

        devShells.x86_64-linux.default = pkgs.mkShell {
            buildInputs = [
                pkgs.cmake
                pkgs.libglvnd
                pkgs.kdePackages.qtdeclarative
                pkgs.kdePackages.qtbase
                pkgs.kdePackages.qttools
                pkgs.kdePackages.wrapQtAppsHook
                pkgs.kdePackages.qt3d
                pkgs.kdePackages.qtquick3d
                pkgs.kdePackages.qtwayland
                pkgs.kdePackages.qtbase
                pkgs.kdePackages.qtnetworkauth
                pkgs.kdePackages.qtscxml
                pkgs.kdePackages.qtsvg
                pkgs.kdePackages.qtwayland
                pkgs.kdePackages.qtwebengine
                pkgs.kdePackages.qt5compat
                pkgs.kdePackages.qtmultimedia
                pkgs.kdePackages.qtshadertools
            ];
            shellHook = ''
                echo entered dev shell
            '';
        };
    };

}

It’s a little messy. I’ll clean it up in the future. (There are a bunch of unnecessary dependencies in there; I just copied and pasted a large list of dependencies from the Digikam package.)
To get the Wayland plugin working, I wrap the built executable with wrapQtApp as in Running locally built Qt apps - #2 by wamserma.

I hope some of this is useful to someone in the future. The documentation is a little arcane.