From e744dd74e8983a2e7443ff0098e75415d4111e47 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 8 Sep 2021 15:50:55 +0200 Subject: feeds: alot & notmuch wrappers --- user-profiles/feeds/alot.config | 50 +++++++++++++++++++++++++++++++++++++++++ user-profiles/feeds/module.nix | 32 ++++++++++++++++++++++++-- 2 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 user-profiles/feeds/alot.config (limited to 'user-profiles') 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 @@ +attachment_prefix="~/Downloads" +bug_on_exit=true +editor_cmd="false" +tabwidth=2 +timestamp_format="%a %d %b %H:%M:%S %Y UTC%z" +auto_remove_unread=True +#initial_command="search ( tag:inbox ) AND NOT ( tag:killed )" +initial_command="search ( tag:inbox ) AND NOT ( is:link OR is:media OR is:killed )" + +[accounts] + [[private]] + realname = @realname@ + address = @address@ + +[bindings] +j = +k = +'g g' = +G = +I = search ( tag:inbox ) AND NOT ( is:killed ) +U = search ( tag:inbox ) AND NOT ( is:link OR is:media OR is:killed ) +V = search ( tag:inbox AND is:media OR ( is:live AND date:12h.. AND NOT is:unread ) ) AND NOT ( is:killed ) +W = search ( is:media ) AND NOT ( tag:inbox OR is:killed OR is:highlight ) +L = search ( tag:inbox AND is:link ) AND NOT ( is:killed ) + +h = move first +t = move up +n = move down +s = move last + [[search]] + a = + s = + + u = toggletags unread + i = toggletags inbox + j = untag unread,inbox + r = toggletags later + [[thread]] + s = + S = + n = + 'g j' = + 'g k' = + 'g l' = + w = save + W = save --all + 'g h' = move parent + 'g t' = move next sibling + 'g n' = move previous sibling + '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 }; in haskellPackages.imm; immWrapped = pkgs.runCommand "${imm.name}-wrapped-${config.home.username}" - { nativeBuildInputs = with pkgs; [ makeWrapper imm ]; + { nativeBuildInputs = with pkgs; [ makeWrapper ]; } '' mkdir -p $out/bin makeWrapper ${imm}/bin/imm $out/bin/imm \ @@ -154,9 +154,37 @@ let path = afewHook; } ]; + + notmuchWrapped = pkgs.runCommand "${pkgs.notmuch.name}-wrapped-${config.home.username}" + { nativeBuildInputs = with pkgs; [ makeWrapper ]; + } '' + mkdir -p $out/bin + makeWrapper ${pkgs.notmuch}/bin/notmuch $out/bin/notmuch-feeds \ + --set NOTMUCH_CONFIG ${configPath} + ''; + alotWrapped = pkgs.runCommand "${pkgs.alot.name}-wrapped-${config.home.username}" + { nativeBuildInputs = with pkgs; [ makeWrapper gnused ]; + } '' + mkdir -p $out/bin + makeWrapper ${pkgs.alot}/bin/alot $out/bin/alot-feeds \ + --add-flags --config=${alotConfig} \ + --add-flags --notmuch-config=${configPath} + + mkdir $out/share + ln -s ${pkgs.alot}/share/alot $out/share + mkdir -p $out/share/applications + sed -r 's/alot/alot-feeds/g' ${pkgs.alot}/share/applications/alot.desktop > $out/share/applications/alot-feeds.desktop + mkdir -p $out/share/zsh/site-functions + sed -r 's/alot/alot-feeds/g' ${pkgs.alot}/share/zsh/site-functions/_alot > $out/share/zsh/site-functions/_alot-feeds + ''; + + alotConfig = pkgs.runCommand "alot" { + realname = notmuchIni.user.name; + address = notmuchIni.user.primary_email; + } "substituteAll ${./alot.config} $out"; in { config = { - home.packages = [ immWrapped ]; + home.packages = [ immWrapped notmuchWrapped pkgs.notmuch.man alotWrapped ]; home.activation.createImm = hm.dag.entryAfter ["writeBoundary"] '' $DRY_RUN_CMD mkdir -p $VERBOSE_ARG ${config.xdg.configHome}/imm -- cgit v1.2.3