diff options
author | Symphorien Gibol <symphorien+git@xlumurb.eu> | 2020-07-13 12:00:00 +0000 |
---|---|---|
committer | Guillaume Girol <symphorien+git@xlumurb.eu> | 2021-03-04 22:17:25 +0100 |
commit | 06b989c1e7fa3b249791c0d0eb772c714224eff7 (patch) | |
tree | c8f69a1b93f224589b3e7771f3153f518de91712 /default.nix | |
parent | 326766126cea11ed94b772bdc79d8b5ccb228957 (diff) |
add full text search support
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/default.nix b/default.nix index b0b64cf..31aa12b 100644 --- a/default.nix +++ b/default.nix @@ -187,6 +187,86 @@ in default = {}; }; + + fullTextSearch = { + enable = mkEnableOption "Full text search indexing with xapian. This has significant performance and disk space cost."; + indexDir = mkOption { + type = types.nullOr types.str; + default = "/var/lib/dovecot/fts_xapian"; + description = '' + Folder to store search indices. If null, indices are stored along with email, which + is not necessarily desirable as indices are voluminous and do not need to be backed up. + ''; + }; + autoIndex = mkOption { + type = types.bool; + default = true; + description = "Enable automatic indexing of messages as they are received or modified."; + }; + autoIndexExclude = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ "\\Trash" "SomeFolder" "Other/*" ]; + description = '' + Mailboxes to exclude from automatic indexing. + ''; + }; + + indexAttachments = mkOption { + type = types.bool; + default = false; + description = "Also index text-only attachements. Binary attachements are never indexed."; + }; + + enforced = mkOption { + type = types.enum [ "yes" "no" "body" ]; + default = "no"; + description = '' + Fail searches when no index is available. If set to + <literal>body</literal>, then only body searches (as opposed to + header) are affected. If set to <literal>no<literal>, searches may + fall back to a very slow brute force search. + ''; + }; + + minSize = mkOption { + type = types.int; + default = 2; + description = "Size of the smallest n-gram to index."; + }; + maxSize = mkOption { + type = types.int; + default = 20; + description = "Size of the largest n-gram to index."; + }; + memoryLimit = mkOption { + type = types.nullOr types.int; + default = null; + example = 2000; + description = "Memory limit for the indexer process, in MiB. If null, leaves the default (which is rather low), and if 0, no limit."; + }; + + maintenance = { + enable = mkOption { + type = types.bool; + default = true; + description = "Regularly optmize indices, as recommended by upstream."; + }; + + onCalendar = mkOption { + type = types.str; + default = "daily"; + description = "When to run the maintenance job. See systemd.time(7) for more information about the format."; + }; + + randomizedDelaySec = mkOption { + type = types.int; + default = 1000; + description = "Run the maintenance job not exactly at the time specified with <literal>onCalendar</literal>, but plus or minus this many seconds."; + }; + }; + }; + lmtpSaveToDetailMailbox = mkOption { type = types.enum ["yes" "no"]; default = "yes"; |