From 404284ccca84cec8d0870e3be1a4263fc2bc9f8b Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 6 Aug 2018 19:11:40 +0900 Subject: [PATCH] notmuch: adding contact completion helpers so that MUAs can more easily look for contacts. --- modules/programs/notmuch.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/programs/notmuch.nix b/modules/programs/notmuch.nix index 3d7a651f..84e0e41b 100644 --- a/modules/programs/notmuch.nix +++ b/modules/programs/notmuch.nix @@ -86,6 +86,24 @@ in ''; }; + contactCompletion = mkOption { + type = types.enum [ "address" "simple" ]; + default = "address"; + apply = val: + + if val == "address" then '' + ${pkgs.bash}/bin/bash -c "${pkgs.notmuch}/bin/notmuch address --format=json --output=recipients date:1Y.."' + regexp = '\[?{"name": "(?P.*)", "address": "(?P.+)", "name-addr": ".*"}[,\]]?' '' + else if val == "config" then + "'${pkgs.notmuch}/bin/notmuch address --format=json date:1Y..'" + else ""; + + description = '' + A list of tags that will be added to all messages + incorporated by notmuch new. + ''; + }; + extraConfig = mkOption { type = types.attrsOf (types.attrsOf types.str); default = {