diff --git a/packages/notcoal/Cargo.lock.patch b/packages/notcoal/Cargo.lock.patch new file mode 100644 index 0000000..63de9ff --- /dev/null +++ b/packages/notcoal/Cargo.lock.patch @@ -0,0 +1,622 @@ +diff --git a/Cargo.lock b/Cargo.lock +new file mode 100644 +index 0000000..1bcb060 +--- /dev/null ++++ b/Cargo.lock +@@ -0,0 +1,616 @@ ++# This file is automatically @generated by Cargo. ++# It is not intended for manual editing. ++[[package]] ++name = "ahash" ++version = "0.3.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" ++ ++[[package]] ++name = "aho-corasick" ++version = "0.7.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" ++dependencies = [ ++ "memchr", ++] ++ ++[[package]] ++name = "ansi_term" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" ++dependencies = [ ++ "winapi", ++] ++ ++[[package]] ++name = "arrayref" ++version = "0.3.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" ++ ++[[package]] ++name = "arrayvec" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" ++ ++[[package]] ++name = "atty" ++version = "0.2.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" ++dependencies = [ ++ "hermit-abi", ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "autocfg" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" ++ ++[[package]] ++name = "base64" ++version = "0.10.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" ++dependencies = [ ++ "byteorder", ++] ++ ++[[package]] ++name = "base64" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" ++ ++[[package]] ++name = "base64" ++version = "0.12.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" ++ ++[[package]] ++name = "bitflags" ++version = "1.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" ++ ++[[package]] ++name = "blake2b_simd" ++version = "0.5.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" ++dependencies = [ ++ "arrayref", ++ "arrayvec", ++ "constant_time_eq", ++] ++ ++[[package]] ++name = "byteorder" ++version = "1.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" ++ ++[[package]] ++name = "cfg-if" ++version = "0.1.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" ++ ++[[package]] ++name = "charset" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4f426e64df1c3de26cbf44593c6ffff5dbfd43bbf9de0d075058558126b3fc73" ++dependencies = [ ++ "base64 0.10.1", ++ "encoding_rs", ++] ++ ++[[package]] ++name = "clap" ++version = "2.33.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" ++dependencies = [ ++ "ansi_term", ++ "atty", ++ "bitflags", ++ "strsim", ++ "textwrap", ++ "unicode-width", ++ "vec_map", ++] ++ ++[[package]] ++name = "constant_time_eq" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" ++ ++[[package]] ++name = "crossbeam-utils" ++version = "0.7.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" ++dependencies = [ ++ "autocfg", ++ "cfg-if", ++ "lazy_static", ++] ++ ++[[package]] ++name = "dirs" ++version = "2.0.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" ++dependencies = [ ++ "cfg-if", ++ "dirs-sys", ++] ++ ++[[package]] ++name = "dirs-sys" ++version = "0.3.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" ++dependencies = [ ++ "libc", ++ "redox_users", ++ "winapi", ++] ++ ++[[package]] ++name = "dlv-list" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1b391911b9a786312a10cb9d2b3d0735adfd5a8113eb3648de26a75e91b0826c" ++dependencies = [ ++ "rand", ++] ++ ++[[package]] ++name = "encoding_rs" ++version = "0.8.23" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "getrandom" ++version = "0.1.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "wasi", ++] ++ ++[[package]] ++name = "hashbrown" ++version = "0.7.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf" ++dependencies = [ ++ "ahash", ++ "autocfg", ++] ++ ++[[package]] ++name = "heck" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" ++dependencies = [ ++ "unicode-segmentation", ++] ++ ++[[package]] ++name = "hermit-abi" ++version = "0.1.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "itoa" ++version = "0.4.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" ++ ++[[package]] ++name = "lazy_static" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ++ ++[[package]] ++name = "libc" ++version = "0.2.73" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9" ++ ++[[package]] ++name = "mailparse" ++version = "0.12.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "336d59e50513349423fa89bdadef5b5c49972a6ce0b66d3b2c7c8b7ab3969faf" ++dependencies = [ ++ "base64 0.12.3", ++ "charset", ++ "quoted_printable", ++] ++ ++[[package]] ++name = "memchr" ++version = "2.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" ++ ++[[package]] ++name = "notcoal" ++version = "0.4.0" ++dependencies = [ ++ "dirs", ++ "mailparse", ++ "notmuch", ++ "regex", ++ "rust-ini", ++ "serde", ++ "serde_json", ++ "structopt", ++] ++ ++[[package]] ++name = "notmuch" ++version = "0.6.0" ++dependencies = [ ++ "libc", ++ "supercow", ++] ++ ++[[package]] ++name = "ordered-multimap" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e88f947c6799d5eff50e6cf8a2365c17ac4aa8f8f43aceeedc29b616d872a358" ++dependencies = [ ++ "dlv-list", ++ "hashbrown", ++] ++ ++[[package]] ++name = "ppv-lite86" ++version = "0.2.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" ++ ++[[package]] ++name = "proc-macro-error" ++version = "1.0.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fc175e9777c3116627248584e8f8b3e2987405cabe1c0adf7d1dd28f09dc7880" ++dependencies = [ ++ "proc-macro-error-attr", ++ "proc-macro2", ++ "quote", ++ "syn", ++ "version_check", ++] ++ ++[[package]] ++name = "proc-macro-error-attr" ++version = "1.0.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3cc9795ca17eb581285ec44936da7fc2335a3f34f2ddd13118b6f4d515435c50" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn", ++ "syn-mid", ++ "version_check", ++] ++ ++[[package]] ++name = "proc-macro2" ++version = "1.0.19" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" ++dependencies = [ ++ "unicode-xid", ++] ++ ++[[package]] ++name = "quote" ++version = "1.0.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" ++dependencies = [ ++ "proc-macro2", ++] ++ ++[[package]] ++name = "quoted_printable" ++version = "0.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "47b080c5db639b292ac79cbd34be0cfc5d36694768d8341109634d90b86930e2" ++ ++[[package]] ++name = "rand" ++version = "0.7.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" ++dependencies = [ ++ "getrandom", ++ "libc", ++ "rand_chacha", ++ "rand_core", ++ "rand_hc", ++] ++ ++[[package]] ++name = "rand_chacha" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" ++dependencies = [ ++ "ppv-lite86", ++ "rand_core", ++] ++ ++[[package]] ++name = "rand_core" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" ++dependencies = [ ++ "getrandom", ++] ++ ++[[package]] ++name = "rand_hc" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" ++dependencies = [ ++ "rand_core", ++] ++ ++[[package]] ++name = "redox_syscall" ++version = "0.1.57" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" ++ ++[[package]] ++name = "redox_users" ++version = "0.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" ++dependencies = [ ++ "getrandom", ++ "redox_syscall", ++ "rust-argon2", ++] ++ ++[[package]] ++name = "regex" ++version = "1.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" ++dependencies = [ ++ "aho-corasick", ++ "memchr", ++ "regex-syntax", ++ "thread_local", ++] ++ ++[[package]] ++name = "regex-syntax" ++version = "0.6.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" ++ ++[[package]] ++name = "rust-argon2" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" ++dependencies = [ ++ "base64 0.11.0", ++ "blake2b_simd", ++ "constant_time_eq", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "rust-ini" ++version = "0.15.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7a3679dd538c876a7b606f3bb951c8a20fc281a0ff7795f59f7cb490e3f979e1" ++dependencies = [ ++ "cfg-if", ++ "ordered-multimap", ++] ++ ++[[package]] ++name = "ryu" ++version = "1.0.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" ++ ++[[package]] ++name = "serde" ++version = "1.0.114" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" ++dependencies = [ ++ "serde_derive", ++] ++ ++[[package]] ++name = "serde_derive" ++version = "1.0.114" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn", ++] ++ ++[[package]] ++name = "serde_json" ++version = "1.0.57" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" ++dependencies = [ ++ "itoa", ++ "ryu", ++ "serde", ++] ++ ++[[package]] ++name = "strsim" ++version = "0.8.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" ++ ++[[package]] ++name = "structopt" ++version = "0.3.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "de2f5e239ee807089b62adce73e48c625e0ed80df02c7ab3f068f5db5281065c" ++dependencies = [ ++ "clap", ++ "lazy_static", ++ "structopt-derive", ++] ++ ++[[package]] ++name = "structopt-derive" ++version = "0.4.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "510413f9de616762a4fbeab62509bf15c729603b72d7cd71280fbca431b1c118" ++dependencies = [ ++ "heck", ++ "proc-macro-error", ++ "proc-macro2", ++ "quote", ++ "syn", ++] ++ ++[[package]] ++name = "supercow" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "171758edb47aa306a78dfa4ab9aeb5167405bd4e3dc2b64e88f6a84bbe98bd63" ++ ++[[package]] ++name = "syn" ++version = "1.0.36" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-xid", ++] ++ ++[[package]] ++name = "syn-mid" ++version = "0.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn", ++] ++ ++[[package]] ++name = "textwrap" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" ++dependencies = [ ++ "unicode-width", ++] ++ ++[[package]] ++name = "thread_local" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" ++dependencies = [ ++ "lazy_static", ++] ++ ++[[package]] ++name = "unicode-segmentation" ++version = "1.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" ++ ++[[package]] ++name = "unicode-width" ++version = "0.1.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" ++ ++[[package]] ++name = "unicode-xid" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" ++ ++[[package]] ++name = "vec_map" ++version = "0.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" ++ ++[[package]] ++name = "version_check" ++version = "0.9.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" ++ ++[[package]] ++name = "wasi" ++version = "0.9.0+wasi-snapshot-preview1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" ++ ++[[package]] ++name = "winapi" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" ++dependencies = [ ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", ++] ++ ++[[package]] ++name = "winapi-i686-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" ++ ++[[package]] ++name = "winapi-x86_64-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/packages/notcoal/default.nix b/packages/notcoal/default.nix new file mode 100644 index 0000000..e571836 --- /dev/null +++ b/packages/notcoal/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, rustPlatform, notmuch, bash }: + +rustPlatform.buildRustPackage rec { + pname = "notcoal"; + version = "0.3.0"; + + src = fetchTarball { + url = https://ghom.niij.org/eaon/notcoal/archive/v0.3.0.tar.gz; + sha256 = "19gaba6asid5vplcy9q0ama40dvwwxglc40ks5240lydrvgfrimq"; + }; + cargoPatches = [ + ./Cargo.lock.patch + ]; + cargoSha256 = "0kgjxq2319l2gh1xc0f3ir1pa6z7p62z3fccswwxrz7gbn7nc07c"; + cargoBuildFlags = ["--feature=standalone"]; + + buildInputs = [ + bash + notmuch + ]; + + + meta = with stdenv.lib; { + description = "An email tagger for notmuch"; + homepage = "https://ghom.niij.org/eaon/notcoal"; + }; +} diff --git a/roles/mail.nix b/roles/mail.nix index 9aabab4..93f6a3f 100644 --- a/roles/mail.nix +++ b/roles/mail.nix @@ -1,6 +1,8 @@ { config, lib, pkgs, ... }: -{ +let + notcoal = pkgs.callPackage (import ../packages/notcoal) {}; +in { environment.systemPackages = with pkgs; [ astroid isync