diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..b9238c3 --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +use flake diff --git a/.gitignore b/.gitignore index c31fef4..8ab215c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ -# Generated by Cargo -Cargo.lock +.direnv/ +coverage/ debug/ target/ - -# Code coverage results -coverage/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c945397 --- /dev/null +++ b/flake.lock @@ -0,0 +1,128 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706006310, + "narHash": "sha256-nDPz0fj0IFcDhSTlXBU2aixcnGs2Jm4Zcuoj0QtmiXQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b43bb235efeab5324c5e486882ef46749188eee2", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1681358109, + "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1706149103, + "narHash": "sha256-Me28A0tAb1EzZIozfi31+hnsQIaYU0HXaMPWCe+zByc=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "493cc67d5e9f1b298241b8d92aa06883296acc3f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b394bb9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,17 @@ +{ + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + rust-overlay.url = "github:oxalica/rust-overlay"; + }; + + outputs = { self, nixpkgs, flake-utils, rust-overlay }: + flake-utils.lib.eachDefaultSystem (system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { inherit system overlays; }; + in + { + devShells.default = import ./shell.nix { inherit pkgs; }; + } + ); +} diff --git a/rustup-toolchain.toml b/rustup-toolchain.toml new file mode 100644 index 0000000..0a15096 --- /dev/null +++ b/rustup-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "stable" +components = ["cargo", "clippy", "rustfmt", "rust-src"] diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..a945393 --- /dev/null +++ b/shell.nix @@ -0,0 +1,18 @@ +{ pkgs ? import { } }: + +with pkgs; + +let + rustup-toolchain = rust-bin.fromRustupToolchainFile ./rustup-toolchain.toml; +in +mkShell rec { + packages = [ + cargo-audit + cargo-edit + cargo-make + cargo-outdated + cargo-tarpaulin + rustup-toolchain + typos + ]; +} diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000..bb62527 --- /dev/null +++ b/typos.toml @@ -0,0 +1,2 @@ +[default.extend-words] +BA = "BA"