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 = {