{ description = "Improvise — Multi-Dimensional Data Modeling Terminal Application"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; beads.url = "github:gastownhall/beads/v1.3.0"; rust-overlay = { url = "github:oxalica/rust-overlay"; }; flake-utils.url = "github:numtide/flake-utils"; crate2nix.url = "github:nix-community/crate2nix"; }; outputs = { self, beads, 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"]; # The browser deployment targets wasm; without this, the wasm audit # (improvise-ywd) and the OPFS backend (improvise-i34) cannot even be # checked, let alone fixed. targets = ["wasm32-unknown-unknown"]; }; cargoNix = import ./Cargo.nix { inherit nixpkgs pkgs; }; in { inherit cargoNix; devShells.default = pkgs.mkShell { nativeBuildInputs = [ rustToolchain pkgs.pkg-config pkgs.rust-analyzer crate2nix.packages.${system}.default pkgs.cargo-expand pkgs.cargo-llvm-cov pkgs.global pkgs.universal-ctags beads.packages.${system}.default # `scripts/kb` and the CI knowledge-base check both run trealla. It # was reached through `nix shell nixpkgs#trealla` per invocation, # which cost more than the work: the tool's first real use took past # two minutes for a write that takes half a second on PATH. pkgs.trealla # `web/build.sh` — and so the Pages job's local dry run — needs this. # The `wasm` CI job only runs `cargo check`, which does not, so the # shell was missing the one tool that turns a passing check into a # loadable page (improvise-d31). pkgs.wasm-pack # 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 = { improvise = cargoNix.workspaceMembers.improvise.build; default = self.packages.${system}.improvise; }; }); }