sort strings according to edit distance
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

46 lines
1.3 KiB

{
description = "sort lines by their similarity to a candidate string";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, flake-utils, naersk }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
naersk-lib = naersk.lib.${system};
in rec {
# `nix build`
packages.similar-sort = naersk-lib.buildPackage ./.;
defaultPackage = packages.similar-sort;
overlay = final: prev: { similar-sort = packages.similar-sort; };
# `nix run`
apps.similar-sort =
flake-utils.lib.mkApp { drv = packages.similar-sort; };
defaultApp = apps.similar-sort;
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = [
pkgs.cargo
pkgs.cargo-edit
pkgs.cargo-watch
pkgs.rustPackages.clippy
pkgs.rustc
pkgs.rustfmt
# for some reason this is always needed when building Rust stuff, at
# least on macOS
pkgs.libiconv
];
RUST_SRC_PATH =
"${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
});
}