engram 0.7.12

A fast and space-efficient version control system for portable file backups
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    rust-overlay.url = "github:oxalica/rust-overlay";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    {
      self,
      nixpkgs,
      rust-overlay,
      flake-utils,
      ...
    }:
    flake-utils.lib.eachDefaultSystem (
      system:
      let
        overlays = [ (import rust-overlay) ];
        pkgs = import nixpkgs {
          inherit system overlays;
        };
        toolchain = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml);
        manifest = (pkgs.lib.importTOML ./Cargo.toml).package;
      in
      {
        packages.default =
          (pkgs.makeRustPlatform {
            cargo = toolchain;
            rustc = toolchain;
          }).buildRustPackage
            rec {
              pname = manifest.name;
              cargoLock.lockFile = ./Cargo.lock;
              src = pkgs.lib.cleanSource ./.;
              buildType = "release";
              version = manifest.version;
              RUSTFLAGS = "-C target-cpu=native";
              nativeBuildInputs = [
                pkgs.cmake
              ];
            };
        devShells.default = pkgs.mkShell {
          buildInputs = [
            toolchain
            pkgs.cmake
          ];
        };
      }
    );
}