diff options
Diffstat (limited to 'user-profiles')
-rw-r--r-- | user-profiles/feeds/alot.config | 50 | ||||
-rw-r--r-- | user-profiles/feeds/module.nix | 32 |
2 files changed, 80 insertions, 2 deletions
diff --git a/user-profiles/feeds/alot.config b/user-profiles/feeds/alot.config new file mode 100644 index 00000000..a14d4539 --- /dev/null +++ b/user-profiles/feeds/alot.config | |||
@@ -0,0 +1,50 @@ | |||
1 | attachment_prefix="~/Downloads" | ||
2 | bug_on_exit=true | ||
3 | editor_cmd="false" | ||
4 | tabwidth=2 | ||
5 | timestamp_format="%a %d %b %H:%M:%S %Y UTC%z" | ||
6 | auto_remove_unread=True | ||
7 | #initial_command="search ( tag:inbox ) AND NOT ( tag:killed )" | ||
8 | initial_command="search ( tag:inbox ) AND NOT ( is:link OR is:media OR is:killed )" | ||
9 | |||
10 | [accounts] | ||
11 | [[private]] | ||
12 | realname = @realname@ | ||
13 | address = @address@ | ||
14 | |||
15 | [bindings] | ||
16 | j = | ||
17 | k = | ||
18 | 'g g' = | ||
19 | G = | ||
20 | I = search ( tag:inbox ) AND NOT ( is:killed ) | ||
21 | U = search ( tag:inbox ) AND NOT ( is:link OR is:media OR is:killed ) | ||
22 | V = search ( tag:inbox AND is:media OR ( is:live AND date:12h.. AND NOT is:unread ) ) AND NOT ( is:killed ) | ||
23 | W = search ( is:media ) AND NOT ( tag:inbox OR is:killed OR is:highlight ) | ||
24 | L = search ( tag:inbox AND is:link ) AND NOT ( is:killed ) | ||
25 | |||
26 | h = move first | ||
27 | t = move up | ||
28 | n = move down | ||
29 | s = move last | ||
30 | [[search]] | ||
31 | a = | ||
32 | s = | ||
33 | |||
34 | u = toggletags unread | ||
35 | i = toggletags inbox | ||
36 | j = untag unread,inbox | ||
37 | r = toggletags later | ||
38 | [[thread]] | ||
39 | s = | ||
40 | S = | ||
41 | n = | ||
42 | 'g j' = | ||
43 | 'g k' = | ||
44 | 'g l' = | ||
45 | w = save | ||
46 | W = save --all | ||
47 | 'g h' = move parent | ||
48 | 'g t' = move next sibling | ||
49 | 'g n' = move previous sibling | ||
50 | 'g s' = move first reply \ No newline at end of file | ||
diff --git a/user-profiles/feeds/module.nix b/user-profiles/feeds/module.nix index da992b8c..de1a65c6 100644 --- a/user-profiles/feeds/module.nix +++ b/user-profiles/feeds/module.nix | |||
@@ -55,7 +55,7 @@ let | |||
55 | }; | 55 | }; |
56 | in haskellPackages.imm; | 56 | in haskellPackages.imm; |
57 | immWrapped = pkgs.runCommand "${imm.name}-wrapped-${config.home.username}" | 57 | immWrapped = pkgs.runCommand "${imm.name}-wrapped-${config.home.username}" |
58 | { nativeBuildInputs = with pkgs; [ makeWrapper imm ]; | 58 | { nativeBuildInputs = with pkgs; [ makeWrapper ]; |
59 | } '' | 59 | } '' |
60 | mkdir -p $out/bin | 60 | mkdir -p $out/bin |
61 | makeWrapper ${imm}/bin/imm $out/bin/imm \ | 61 | makeWrapper ${imm}/bin/imm $out/bin/imm \ |
@@ -154,9 +154,37 @@ let | |||
154 | path = afewHook; | 154 | path = afewHook; |
155 | } | 155 | } |
156 | ]; | 156 | ]; |
157 | |||
158 | notmuchWrapped = pkgs.runCommand "${pkgs.notmuch.name}-wrapped-${config.home.username}" | ||
159 | { nativeBuildInputs = with pkgs; [ makeWrapper ]; | ||
160 | } '' | ||
161 | mkdir -p $out/bin | ||
162 | makeWrapper ${pkgs.notmuch}/bin/notmuch $out/bin/notmuch-feeds \ | ||
163 | --set NOTMUCH_CONFIG ${configPath} | ||
164 | ''; | ||
165 | alotWrapped = pkgs.runCommand "${pkgs.alot.name}-wrapped-${config.home.username}" | ||
166 | { nativeBuildInputs = with pkgs; [ makeWrapper gnused ]; | ||
167 | } '' | ||
168 | mkdir -p $out/bin | ||
169 | makeWrapper ${pkgs.alot}/bin/alot $out/bin/alot-feeds \ | ||
170 | --add-flags --config=${alotConfig} \ | ||
171 | --add-flags --notmuch-config=${configPath} | ||
172 | |||
173 | mkdir $out/share | ||
174 | ln -s ${pkgs.alot}/share/alot $out/share | ||
175 | mkdir -p $out/share/applications | ||
176 | sed -r 's/alot/alot-feeds/g' ${pkgs.alot}/share/applications/alot.desktop > $out/share/applications/alot-feeds.desktop | ||
177 | mkdir -p $out/share/zsh/site-functions | ||
178 | sed -r 's/alot/alot-feeds/g' ${pkgs.alot}/share/zsh/site-functions/_alot > $out/share/zsh/site-functions/_alot-feeds | ||
179 | ''; | ||
180 | |||
181 | alotConfig = pkgs.runCommand "alot" { | ||
182 | realname = notmuchIni.user.name; | ||
183 | address = notmuchIni.user.primary_email; | ||
184 | } "substituteAll ${./alot.config} $out"; | ||
157 | in { | 185 | in { |
158 | config = { | 186 | config = { |
159 | home.packages = [ immWrapped ]; | 187 | home.packages = [ immWrapped notmuchWrapped pkgs.notmuch.man alotWrapped ]; |
160 | 188 | ||
161 | home.activation.createImm = hm.dag.entryAfter ["writeBoundary"] '' | 189 | home.activation.createImm = hm.dag.entryAfter ["writeBoundary"] '' |
162 | $DRY_RUN_CMD mkdir -p $VERBOSE_ARG ${config.xdg.configHome}/imm | 190 | $DRY_RUN_CMD mkdir -p $VERBOSE_ARG ${config.xdg.configHome}/imm |