summaryrefslogtreecommitdiff
path: root/user-profiles
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-09-08 15:50:55 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2021-09-08 15:50:55 +0200
commite744dd74e8983a2e7443ff0098e75415d4111e47 (patch)
treed5c5f83161fa2f2991eb54116211f2f43c61f8ba /user-profiles
parent4a29dc777b2f31b89de3f17fc99b9604f31f6192 (diff)
downloadnixos-e744dd74e8983a2e7443ff0098e75415d4111e47.tar
nixos-e744dd74e8983a2e7443ff0098e75415d4111e47.tar.gz
nixos-e744dd74e8983a2e7443ff0098e75415d4111e47.tar.bz2
nixos-e744dd74e8983a2e7443ff0098e75415d4111e47.tar.xz
nixos-e744dd74e8983a2e7443ff0098e75415d4111e47.zip
feeds: alot & notmuch wrappers
Diffstat (limited to 'user-profiles')
-rw-r--r--user-profiles/feeds/alot.config50
-rw-r--r--user-profiles/feeds/module.nix32
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 @@
1attachment_prefix="~/Downloads"
2bug_on_exit=true
3editor_cmd="false"
4tabwidth=2
5timestamp_format="%a %d %b %H:%M:%S %Y UTC%z"
6auto_remove_unread=True
7#initial_command="search ( tag:inbox ) AND NOT ( tag:killed )"
8initial_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]
16j =
17k =
18'g g' =
19G =
20I = search ( tag:inbox ) AND NOT ( is:killed )
21U = search ( tag:inbox ) AND NOT ( is:link OR is:media OR is:killed )
22V = search ( tag:inbox AND is:media OR ( is:live AND date:12h.. AND NOT is:unread ) ) AND NOT ( is:killed )
23W = search ( is:media ) AND NOT ( tag:inbox OR is:killed OR is:highlight )
24L = search ( tag:inbox AND is:link ) AND NOT ( is:killed )
25
26h = move first
27t = move up
28n = move down
29s = 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";
157in { 185in {
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