brichka 0.2.2

Cli tools for databricks
{
  description = "Kent";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    make-shell.url = "github:nicknovitski/make-shell";
    rust-overlay.url = "github:oxalica/rust-overlay";

  };

  outputs =
    inputs@{
      flake-parts,
      make-shell,
      rust-overlay,
      ...
    }:
    flake-parts.lib.mkFlake { inherit inputs; } {
      imports = [
        make-shell.flakeModules.default
      ];
      systems = [
        "x86_64-linux"
        "aarch64-linux"
        "aarch64-darwin"
        "x86_64-darwin"
      ];
      perSystem =
        {
          pkgs,
          system,
          lib,
          ...
        }:
        let
          cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);

          rustPackage = pkgs.rust-bin.stable.latest.minimal;

          brichka =
            (pkgs.makeRustPlatform {
              cargo = rustPackage;
              rustc = rustPackage;
            }).buildRustPackage
              {
                inherit (cargoToml.package) name version;
                src = ./.;
                cargoLock.lockFile = ./Cargo.lock;
                nativeBuildInputs = [
                  rustPackage
                  pkgs.pkg-config
                ];
                buildInputs = [
                  pkgs.openssl
                ];
              };
        in
        {
          _module.args.pkgs = import inputs.nixpkgs {
            inherit system;
            overlays = [ (import rust-overlay) ];
          };

          make-shells = {
            default = {
              buildInputs = [ rustPackage ];
            };

            test.buildInputs = [ brichka ];
          };

          packages = {
            inherit brichka;
            default = brichka;
          };
        };
    };
}