nancyrs/flake.nix
Jacob Hinkle 3556590f7b Work out using rusqlite and migrations.
This is a big commit where I learned how to do proper error tracking,
including handling From properly, and deriving it in some cases. The
record subcommand still is not implemented but will be easier now that I
decided to use SQLite temp tables as my data structure. This means I can
simply implement a few loops in the fs submodule in order to scan
directories, and dump entries into temp tables. When finished, I'll drop
the tables. This is nice because SQLite already contains a very
efficient BTree implementation that we can use with indices on these
temp tables. It also means we don't have to hold possibly millions of
directory entries in memory, and most importantly, we don't have to
figure out a bidirectional tree structure in rust.
2022-10-26 12:37:47 -04:00

45 lines
1.4 KiB
Nix

{
inputs = {
#naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
crate2nix = {
url = "github:kolloch/crate2nix";
flake = false;
};
};
outputs = { self, nixpkgs, utils, crate2nix }:
utils.lib.eachDefaultSystem (system:
let
crateName = "nancy";
pkgs = import nixpkgs { inherit system; };
inherit (import "${crate2nix}/tools.nix" { inherit pkgs; })
generatedCargoNix;
#naersk-lib = pkgs.callPackage naersk { };
project = import (generatedCargoNix {
name = crateName;
src = ./.;
}) {
inherit pkgs;
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
# Crate dependency overrides go here
};
};
in
{
packages.${crateName} = project.rootCrate.build;
defaultPackage = self.packages.${system}.${crateName};
#defaultPackage = naersk-lib.buildPackage ./.;
devShell = with pkgs; mkShell {
inputsFrom = builtins.attrValues self.packages.${system};
buildInputs = [
cargo
rust-analyzer clippy rustfmt # linting
sqlite
openssl pkgconfig # for openssl-sys dep that gets pulled in
];
};
});
}