{
  description = "Improvise — Multi-Dimensional Data Modeling Terminal Application";

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

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

      rustToolchain = pkgs.rust-bin.stable.latest.default.override {
        extensions = ["rust-src" "clippy" "rustfmt" "llvm-tools-preview"];
      };

      generatedCargoNix = crate2nix.tools.${system}.generatedCargoNix {
        name = "improvise";
        src = ./.;
      };

      cargoNix = import generatedCargoNix {
        pkgs = pkgs;
      };
    in {
      devShells.default = pkgs.mkShell {
        nativeBuildInputs = [
          rustToolchain
          pkgs.pkg-config
          pkgs.rust-analyzer
          crate2nix.packages.${system}.default
          pkgs.cargo-expand
          pkgs.cargo-llvm-cov

          # Demo recording and release tooling
          pkgs.asciinema
          pkgs.vhs
          pkgs.cargo-dist
          # nixpkgs cargo-dist installs as "dist"; alias so `cargo dist` works
          (pkgs.writeShellScriptBin "cargo-dist" ''exec ${pkgs.cargo-dist}/bin/dist "$@"'')
        ];
        RUST_BACKTRACE = "1";
      };

      packages.default = cargoNix.rootCrate.build;
    });
}
