{
  description = "C++ dev shell with CMake and clangd";

  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

  outputs = { self, nixpkgs }:
    let
      systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
      forAll = f: nixpkgs.lib.genAttrs systems (s: f nixpkgs.legacyPackages.${s});
    in {
      devShells = forAll (pkgs: {
        default = pkgs.mkShell {
          packages = with pkgs; [
            cmake
            clang-tools   # provides clangd, clang-format, clang-tidy
            llvmPackages.clang
            ninja         # optional but pairs well with cmake
            catch2        # testing framework
          ];

          shellHook = ''
            export CC=clang
            export CXX=clang++
          '';
        };
      });
    };
}
