added stuff

This commit is contained in:
vali 2024-04-09 23:11:33 +02:00
commit 7d4f626b7d
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,53 @@
{
binds = [
{
# Reply to a group or mailing list.
action = "group-reply";
key = "R";
map = [
"index"
"pager"
];
}
{
# Move to the previous box in the sidebar.
action = "sidebar-prev";
key = "\\cK";
map = [
"index"
"pager"
];
}
{
# Move to the next box in the sidebar.
action = "sidebar-next";
key = "\\cJ";
map = [
"index"
"pager"
];
}
{
# Open the current box highlighted in the sidebar.
action = "sidebar-open";
key = "\\cO";
map = [
"index"
"pager"
];
}
{
# View the raw contents of a message.
action = "view-raw-message";
key = "Z";
map = [
"index"
"pager"
];
}
];
}

View file

@ -0,0 +1,77 @@
# vim: filetype=nix
{pkgs, ...}: {
muttColors = pkgs.writeTextFile {
name = "muttColors";
text = ''
# vim: filetype=muttrc
# Header colors:
color header blue default ".*"
color header brightmagenta default "^(From)"
color header brightcyan default "^(Subject)"
color header brightwhite default "^(CC|BCC)"
mono bold bold
mono underline underline
mono indicator reverse
mono error bold
color normal default default
color indicator brightyellow default # currently selected message. default makes bar clear, disabled arrow to save space.
color sidebar_highlight red default
color sidebar_divider brightblack black
color sidebar_flagged red black
color sidebar_new green black
color normal brightyellow default
color error red default
color tilde black default
color message cyan default
color markers red white
color attachment white default
color search brightmagenta default
color status brightyellow black
color hdrdefault brightgreen default
color quoted green default
color quoted1 blue default
color quoted2 cyan default
color quoted3 yellow default
color quoted4 red default
color quoted5 brightred default
color signature brightgreen default
color bold black default
color underline black default
color normal default default
color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses
color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL
color body green default "\`[^\`]*\`" # Green text between ` and `
color body brightblue default "^# \.*" # Headings as bold blue
color body brightcyan default "^## \.*" # Subheadings as bold cyan
color body brightgreen default "^### \.*" # Subsubheadings as bold green
color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow
color body brightcyan default "[;:][-o][)/(|]" # emoticons
color body brightcyan default "[;:][)(|]" # emoticons
color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon?
color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon?
color body red default "(BAD signature)"
color body cyan default "(Good signature)"
color body brightblack default "^gpg: Good signature .*"
color body brightyellow default "^gpg: "
color body brightyellow red "^gpg: BAD signature from.*"
mono body bold "^gpg: Good signature"
mohttps://neomutt.org/code/config_vars.htmlno body bold "^gpg: BAD signature from.*"
color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
# Default index colors:
color index yellow default '.*'
color index_author red default '.*'
color index_number blue default
color index_subject cyan default '.*'
# For new mail:
color index brightyellow black "~N"
color index_author brightred black "~N"
color index_subject brightcyan black "~N"
color progress black cyan
'';
};
}

View file

@ -0,0 +1,74 @@
{
config,
lib,
...
}: let
inherit (lib) mapAttrsToList flatten concatStringsSep;
in {
config = {
programs.neomutt = {
enable = true;
vimKeys = true;
checkStatsInterval = 60;
# sidebar
sidebar = {
enable = true;
width = 30;
format = "%D%?F? [%F]?%* %?N?%N/?%S";
};
# sort default view by threads
sort = "threads";
# get keybinds from their respective file
inherit (import ./binds.nix) binds;
# get settings from their respective file
inherit (import ./settings.nix {inherit config;}) settings;
# get macros from their respective file
inherit (import ./macros.nix) macros;
extraConfig = let
# collect all addresses and aliases from accounts.email.accounts attribute of home-manager
accounts = mapAttrsToList (_: value: [value.address] ++ value.aliases) config.accounts.email.accounts;
addresses = flatten accounts;
in ''
# add collected accounts to neomutt config
alternates "${concatStringsSep "|" addresses}"
# mark anything marked by SpamAssassin as probably spam
spam "X-Spam-Score: ([0-9\\.]+).*" "SA: %1"
# only show the basic mail headers
ignore *
unignore From To Cc Bcc Date Subject
# show headers in the following order
unhdr_order *
hdr_order From: To: Cc: Bcc: Date: Subject:
'';
};
xdg = {
desktopEntries = {
neomutt = {
name = "Neomutt";
genericName = "Email Client";
comment = "Read and send emails";
exec = "neomutt %U";
icon = "neomutt";
terminal = true;
categories = ["Network" "Email" "ConsoleOnly"];
type = "Application";
mimeType = ["x-scheme-handler/mailto"];
};
};
mimeApps.defaultApplications = {
"x-scheme-handler/mailto" = "neomutt.desktop";
};
};
};
}

View file

@ -0,0 +1,15 @@
{
macros = [
{
# toggle the sidebar's visibility and refresh/redraw the screen
action = "<enter-command>toggle sidebar_visible<enter><refresh>";
key = "B";
map = ["index"];
}
{
action = "<enter-command>toggle sidebar_visible<enter><redraw-screen>";
key = "B";
map = ["pager"];
}
];
}

View file

@ -0,0 +1,92 @@
{config}: {
settings = {
# if the given mail doesn't have an explicit charset, assume an old
# and Windows-y compatible charset as fallback
assumed_charset = "iso-8859-1";
# use gpgme for cryptography
crypt_use_gpgme = "yes";
# use PKA to find keys via DNS records and possibly check whether an email
# address is controlled by who it says it is
crypt_use_pka = "yes";
# always try to verify signatures
crypt_verify_sig = "yes";
# ask to purge messages marked for delete when closing/syncing a box, with
# the default to do so
delete = "ask-yes";
# when editing outgoing mail, allow editing the headers too
edit_headers = "yes";
# the format to use for subjects when forwarding messages
forward_format = "\"Fwd: %s\"";
# save 10_000 lines of string buffer history per category
history = "10000";
# save history to a file in neomutt's directory
history_file = "${config.xdg.configHome}/neomutt/history";
# when connecting via IMAP, add all subscribed folders from the server
imap_check_subscribed = "yes";
# keep IMAP connections alive with a keepalive every 5 minutes
imap_keepalive = "300";
# use a smaller IMAP pipeline to play nice with servers like GMail
imap_pipeline_depth = "5";
# check for new mail every minute
mail_check = "60";
# the path to the mailcap file
mailcap_path = "${config.home.homeDirectory}/.mailcap";
# use Maildir-style mailboxes
mbox_type = "Maildir";
# scroll menus and such by a single line, rather than a whole page
menu_scroll = "yes";
# show five lines of context when moving between pages in the pager
pager_context = "5";
# the format for the pager status line.
pager_format = "\" %C - %[%H:%M] %.20v, %s%* %?H? [%H] ?\"";
# when in the mail pager, show 10 lines of the index above the current
# message
pager_index_lines = "10";
# don't move to the next message when reaching the bottom of a message
pager_stop = "yes";
# reply to mail using the same address the original was sent to
reverse_name = "yes";
# send all mail as UTF-8
send_charset = "utf-8";
# sort the mailboxes in the sidebar by mailbox path
sidebar_sort_method = "path";
# sort by last message date if messages are in the same thread
sort_aux = "last-date-received";
# separate matching spam headers with this separator
spam_separator = ", ";
# only group messages as a thread by the In-Reply-To or References headers
# rather than matching subject names
strict_threads = "yes";
# search messages against their decoded contents
thorough_search = "yes";
# pad blank lines at the bottom of the screen with tildes
tilde = "yes";
};
}