add mailcap

This commit is contained in:
Ray Andrew 2024-11-04 01:42:28 -06:00
parent be39ff9e2d
commit 260eea3ab0
3 changed files with 41 additions and 2 deletions

View file

@ -13,6 +13,7 @@ in
{ {
imports = [ imports = [
./davmail.nix ./davmail.nix
./mailcap.nix
./neomutt ./neomutt
]; ];
options.custom = with lib; { options.custom = with lib; {
@ -118,13 +119,15 @@ in
mailboxName = "p"; mailboxName = "p";
extraConfig = '' extraConfig = ''
set use_from = yes 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}/inbox" =Inbox
named-mailboxes "${mailboxName}/drafts" =Drafts named-mailboxes "${mailboxName}/drafts" =Drafts
named-mailboxes "${mailboxName}/sent" =Sent named-mailboxes "${mailboxName}/sent" =Sent
named-mailboxes "${mailboxName}/important" =Important named-mailboxes "${mailboxName}/important" =Important
named-mailboxes "${mailboxName}/trash" =Trash named-mailboxes "${mailboxName}/trash" =Trash
named-mailboxes "${mailboxName}/archive" =Archive named-mailboxes "${mailboxName}/archive" =Archive
set pgp_sign_as = 0x07AA5254804C009F
''; '';
}; };
}; };
@ -187,6 +190,9 @@ in
mailboxName = "u"; mailboxName = "u";
extraConfig = '' extraConfig = ''
set use_from = yes 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}/inbox" =Inbox
named-mailboxes "${mailboxName}/drafts" =Drafts named-mailboxes "${mailboxName}/drafts" =Drafts
named-mailboxes "${mailboxName}/sent" =Sent named-mailboxes "${mailboxName}/sent" =Sent
@ -194,7 +200,6 @@ in
named-mailboxes "${mailboxName}/trash" =Trash named-mailboxes "${mailboxName}/trash" =Trash
named-mailboxes "${mailboxName}/archive" =Archive named-mailboxes "${mailboxName}/archive" =Archive
named-mailboxes "${mailboxName}/teaching" =Teaching named-mailboxes "${mailboxName}/teaching" =Teaching
set pgp_sign_as = 0x07AA5254804C009F
''; '';
}; };
}; };

View file

@ -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
'';
};
}

View file

@ -2,4 +2,5 @@ _: {
programs.zathura = { programs.zathura = {
enable = true; enable = true;
}; };
stylix.targets.zathura.enable = true;
} }