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/module.nix | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'user-profiles/feeds/module.nix') 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