diff --git a/src/home/email/default.nix b/src/home/email/default.nix index 9a8be49..5a6d57c 100644 --- a/src/home/email/default.nix +++ b/src/home/email/default.nix @@ -13,6 +13,7 @@ in { imports = [ ./davmail.nix + ./mailcap.nix ./neomutt ]; options.custom = with lib; { @@ -118,13 +119,15 @@ in mailboxName = "p"; extraConfig = '' set use_from = yes + set pgp_verify_sig = yes + set pgp_sign_as = 0x07AA5254804C009F + set pgp_timeout = 3600 named-mailboxes "${mailboxName}/inbox" =Inbox named-mailboxes "${mailboxName}/drafts" =Drafts named-mailboxes "${mailboxName}/sent" =Sent named-mailboxes "${mailboxName}/important" =Important named-mailboxes "${mailboxName}/trash" =Trash named-mailboxes "${mailboxName}/archive" =Archive - set pgp_sign_as = 0x07AA5254804C009F ''; }; }; @@ -187,6 +190,9 @@ in mailboxName = "u"; extraConfig = '' set use_from = yes + set pgp_sign_as = 0x07AA5254804C009F + set pgp_verify_sig = yes + set pgp_timeout = 3600 named-mailboxes "${mailboxName}/inbox" =Inbox named-mailboxes "${mailboxName}/drafts" =Drafts named-mailboxes "${mailboxName}/sent" =Sent @@ -194,7 +200,6 @@ in named-mailboxes "${mailboxName}/trash" =Trash named-mailboxes "${mailboxName}/archive" =Archive named-mailboxes "${mailboxName}/teaching" =Teaching - set pgp_sign_as = 0x07AA5254804C009F ''; }; }; diff --git a/src/home/email/mailcap.nix b/src/home/email/mailcap.nix new file mode 100644 index 0000000..6657539 --- /dev/null +++ b/src/home/email/mailcap.nix @@ -0,0 +1,33 @@ +{ pkgs, lib, config, ... }: + +let + w3m = lib.getExe pkgs.w3m; + zathura = lib.getExe config.programs.zathura.package; + kitty = lib.getExe config.programs.kitty.package; +in +{ + home.packages = with pkgs; [ + mailcap + ]; + + home.file.".mailcap" = { + text = '' +# HTML +# text/html; ${w3m} -sixel -o tmp_dir=~/.cache/w3m -o auto_image=TRUE -o display_image=1 -T text/html %s; nametemplate=%s.html +text/html; ${w3m} -o inline_img_protocol=4 -o tmp_dir=~/.cache/w3m -o auto_image=TRUE -o display_image=1 -T text/html %s; nametemplate=%s.html + +# This second one is chosen by auto_view due to the copiousoutput tag +text/html; ${w3m} -I %{charset} -T text/html -cols 140 -o tmp_dir=~/.cache/w3m -o display_link_number=1 -dump; copiousoutput +text/plain; $EDITOR %s + +#PDFs +application/x-pdf; ${zathura} '%s'; test=test -n "$DISPLAY" +application/pdf; ${zathura} '%s'; test=test -n "$DISPLAY" + +#Images +# image/png; /usr/bin/feh %s +# image/jpeg; /usr/bin/feh %s +image/*; (clear && ${kitty} +kitten icat %s); needsterminal + ''; + }; +} diff --git a/src/home/gui/zathura.nix b/src/home/gui/zathura.nix index 5d0a38f..97fc027 100644 --- a/src/home/gui/zathura.nix +++ b/src/home/gui/zathura.nix @@ -2,4 +2,5 @@ _: { programs.zathura = { enable = true; }; + stylix.targets.zathura.enable = true; }