{
  description = "IAM dev shell aligned with Chainfire/FlareDB toolchain";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    rust-overlay.url = "github:oxalica/rust-overlay";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, rust-overlay, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        overlays = [ (import rust-overlay) ];
        pkgs = import nixpkgs { inherit system overlays; };

        rustToolchain = pkgs.rust-bin.stable.latest.default.override {
          extensions = [ "rust-src" "rust-analyzer" ];
        };
      in {
        devShells.default = pkgs.mkShell {
          buildInputs = with pkgs; [
            rustToolchain
            pkg-config
            openssl
            protobuf
            rocksdb
            clang
            llvmPackages.libclang
            cmake
          ];

          shellHook = ''
            export LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib"
            export PROTOC="${pkgs.protobuf}/bin/protoc"
            export ROCKSDB_LIB_DIR="${pkgs.rocksdb}/lib"
            export ROCKSDB_INCLUDE_DIR="${pkgs.rocksdb}/include"
            echo "IAM development environment loaded!"
            echo "Rust: $(rustc --version)"
            echo "Protoc: $(protoc --version)"
          '';
        };
      });
}
