From 7f748f27bcc7602f9e050dee349bf5805d25a12c Mon Sep 17 00:00:00 2001 From: Evan Stoll Date: Fri, 21 Feb 2020 09:24:52 -0500 Subject: [PATCH] neomutt: add reverse sort options (#1036) --- modules/programs/neomutt.nix | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/modules/programs/neomutt.nix b/modules/programs/neomutt.nix index 85af0353..b6bbae0f 100644 --- a/modules/programs/neomutt.nix +++ b/modules/programs/neomutt.nix @@ -38,6 +38,19 @@ let }; }; + sortOptions = [ + "date" + "date-received" + "from" + "mailbox-order" + "score" + "size" + "spam" + "subject" + "threads" + "to" + ]; + bindModule = types.submodule { options = { map = mkOption { @@ -211,18 +224,9 @@ in { }; sort = mkOption { - type = types.enum [ - "date" - "date-received" - "from" - "mailbox-order" - "score" - "size" - "spam" - "subject" - "threads" - "to" - ]; + # allow users to choose any option from sortOptions, or any option prefixed with "reverse-" + type = types.enum + (sortOptions ++ (map (option: "reverse-" + option) sortOptions)); default = "threads"; description = "Sorting method on messages."; };