fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMerge PR #421575790441

master
1.0 KiB50 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.afew;
8
9in {
10  options.programs.afew = {
11    enable = mkEnableOption "the afew initial tagging script for Notmuch";
12
13    extraConfig = mkOption {
14      type = types.lines;
15      default = ''
16        [SpamFilter]
17        [KillThreadsFilter]
18        [ListMailsFilter]
19        [ArchiveSentMailsFilter]
20        [InboxFilter]
21      '';
22      example = ''
23        [SpamFilter]
24
25        [Filter.0]
26        query = from:pointyheaded@boss.com
27        tags = -new;+boss
28        message = Message from above
29
30        [InboxFilter]
31      '';
32      description = ''
33        Extra lines added to afew configuration file. Available
34        configuration options are described in the afew manual:
35        <https://afew.readthedocs.io/en/latest/configuration.html>.
36      '';
37    };
38  };
39
40  config = mkIf cfg.enable {
41    home.packages = [ pkgs.afew ];
42
43    xdg.configFile."afew/config".text = ''
44      # Generated by Home Manager.
45      # See https://afew.readthedocs.io/
46
47      ${cfg.extraConfig}
48    '';
49  };
50}