From 061c7b633f66ff73b281f08991c6c0a541877e66 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 10 Nov 2018 07:55:21 -0800 Subject: [PATCH] afew: add module --- modules/misc/news.nix | 7 ++++++ modules/modules.nix | 1 + modules/programs/afew.nix | 52 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 modules/programs/afew.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index a6c435b9..e7d7f27d 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -823,6 +823,13 @@ in A new module is available: 'programs.astroid'. ''; } + + { + time = "2018-11-18T21:41:51+00:00"; + message = '' + A new module is available: 'programs.afew'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index d3cf343a..e8f8dbb9 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -26,6 +26,7 @@ let ./misc/qt.nix ./misc/xdg.nix ./programs/alot.nix + ./programs/afew.nix ./programs/autorandr.nix ./programs/astroid.nix ./programs/bash.nix diff --git a/modules/programs/afew.nix b/modules/programs/afew.nix new file mode 100644 index 00000000..99bae88c --- /dev/null +++ b/modules/programs/afew.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.afew; + +in + +{ + options.programs.afew = { + enable = mkEnableOption "the afew initial tagging script for Notmuch"; + + extraConfig = mkOption { + type = types.lines; + default = '' + [SpamFilter] + [KillThreadsFilter] + [ListMailsFilter] + [ArchiveSentMailsFilter] + [InboxFilter] + ''; + example = '' + [SpamFilter] + + [Filter.0] + query = from:pointyheaded@boss.com + tags = -new;+boss + message = Message from above + + [InboxFilter] + ''; + description = '' + Extra lines added to afew configuration file. Available + configuration options are described in the afew manual: + . + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ pkgs.afew ]; + + xdg.configFile."afew/config".text = '' + # Generated by Home Manager. + # See https://afew.readthedocs.io/ + + ${cfg.extraConfig} + ''; + }; +}