diff --git a/dotfiles/isyncrc b/dotfiles/isyncrc new file mode 100644 index 0000000..c24f3dc --- /dev/null +++ b/dotfiles/isyncrc @@ -0,0 +1,38 @@ +IMAPStore smayzy-remote +Host mail.smayzy.ovh +User smayzy@smayzy.ovh +PassCmd "pass mail/smayzy" +TLSType IMAPS + +MaildirStore smayzy-local +Path ~/Mail/smayzy/ +Inbox ~/Mail/smayzy/INBOX +SubFolders Verbatim + +Channel smayzy +Far :smayzy-remote: +Near :smayzy-local: +Create Both +Expunge Both +Patterns * +SyncState * + + +IMAPStore baptiste.maylin-remote +Host mail.smayzy.ovh +User baptiste.maylin@smayzy.ovh +PassCmd "pass mail/baptiste.maylin" +TLSType IMAPS + +MaildirStore baptiste.maylin-local +Path ~/Mail/baptiste.maylin/ +Inbox ~/Mail/baptiste.maylin/INBOX +SubFolders Verbatim + +Channel baptiste.maylin +Far :baptiste.maylin-remote: +Near :baptiste.maylin-local: +Create Both +Expunge Both +Patterns * +SyncState * diff --git a/dotfiles/msmtp/config b/dotfiles/msmtp/config new file mode 100644 index 0000000..830a07a --- /dev/null +++ b/dotfiles/msmtp/config @@ -0,0 +1,25 @@ +defaults +tls on +tls_starttls off +auth on +logfile ~/.msmtp.log +timeout 60 + +account smayzy +host mail.smayzy.ovh +port 465 +domain smayzy.ovh +from smayzy@smayzy.ovh +user smayzy@smayzy.ovh +passwordeval pass mail/smayzy + +account baptiste.maylin +host mail.smayzy.ovh +port 465 +domain smayzy.ovh +from baptiste.maylin@smayzy.ovh +user baptiste.maylin@smayzy.ovh +passwordeval pass mail/baptiste.maylin + + +account default : smayzy diff --git a/dotfiles/neomutt/bind.muttrc b/dotfiles/neomutt/bind.muttrc new file mode 100644 index 0000000..780a898 --- /dev/null +++ b/dotfiles/neomutt/bind.muttrc @@ -0,0 +1,15 @@ +# vim: syntax=neomuttrc +bind index,pager \Ck sidebar-prev +bind index,pager \Cj sidebar-next +bind index,pager \Ce sidebar-open +bind index,pager V sidebar-toggle-visible + + +bind index,pager j next-entry +bind index,pager k previous-entry +bind index,pager J next-page +bind index,pager K previous-page + +bind editor \C_ bol +bind editor \Cd kill-line +bind editor \Cr history-search diff --git a/dotfiles/neomutt/color.muttrc b/dotfiles/neomutt/color.muttrc new file mode 100644 index 0000000..c964d03 --- /dev/null +++ b/dotfiles/neomutt/color.muttrc @@ -0,0 +1,68 @@ +# vim: filetype=neomuttrc +# 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" + +# 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 brightblack white +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" +mono 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<>\"]" + diff --git a/dotfiles/neomutt/muttrc b/dotfiles/neomutt/muttrc new file mode 100644 index 0000000..8f963c9 --- /dev/null +++ b/dotfiles/neomutt/muttrc @@ -0,0 +1,40 @@ +# vim: syntax=neomuttrc +set editor = "vim" + +source color.muttrc +source bind.muttrc + +set ssl_force_tls = yes +set mail_check_stats + +set sidebar_visible = yes +set sidebar_width = 40 +set sidebar_short_path = yes +set sidebar_delim_chars = '/' +set sidebar_on_right = yes +set sidebar_format = '%B%%* %%S' + +set spoolfile = "~/Mail/smayzy/INBOX" +set folder = "~/Mail/smayzy" + +mailboxes `for u in smayzy baptiste.maylin; do echo "$HOME/Mail/placeholder/------$u------"; find ~/Mail/$u -type d -name cur | xargs dirname; done | xargs` + +folder-hook ~/Mail/smayzy/.* "\ + set from='smayzy@smayzy.ovh';\ + set realname='Smayzy';\ + set folder='~/Mail/smayzy';\ + set spoolfile='+INBOX';\ + set record='+Sent';\ + set postponed='+Drafts';\ + set trash='+Trash';\ + set sendmail='msmtp -a smayzy'" + +folder-hook ~/Mail/baptiste.maylin/.* "\ + set from='baptiste.maylin@smayzy.ovh';\ + set realname='Baptiste Maylin';\ + set folder='~/Mail/baptiste.maylin';\ + set spoolfile='+INBOX';\ + set record='+Sent';\ + set postponed='+Drafts';\ + set trash='+Trash';\ + set sendmail='msmtp -a baptiste.maylin'" diff --git a/hosts/desktop1/configuration.nix b/hosts/desktop1/configuration.nix index 18da507..7bd5320 100644 --- a/hosts/desktop1/configuration.nix +++ b/hosts/desktop1/configuration.nix @@ -113,6 +113,4 @@ } ''; - programs.gnupg.agent.enable = true; - } diff --git a/hosts/laptop1/configuration.nix b/hosts/laptop1/configuration.nix index e9fefb5..14bbcaf 100644 --- a/hosts/laptop1/configuration.nix +++ b/hosts/laptop1/configuration.nix @@ -26,6 +26,4 @@ system.stateVersion = "24.11"; networking.hostName = "laptop1"; - - programs.gnupg.agent.enable = true; } diff --git a/modules/home-manager/cli/default.nix b/modules/home-manager/cli/default.nix index aad8d5c..df08129 100644 --- a/modules/home-manager/cli/default.nix +++ b/modules/home-manager/cli/default.nix @@ -2,5 +2,6 @@ { imports = [ ./fastfetch.nix + ./mail.nix ]; } diff --git a/modules/home-manager/cli/mail.nix b/modules/home-manager/cli/mail.nix new file mode 100644 index 0000000..4b65195 --- /dev/null +++ b/modules/home-manager/cli/mail.nix @@ -0,0 +1,29 @@ +{ + lib, + smayzy, + ... +}: +let + mkIf = lib.mkIf; +in +{ + config = mkIf smayzy.mail.enable { + home.file = { + ".config/neomutt" = { + source = builtins.toPath ../../../dotfiles/neomutt; + recursive = true; + force = true; + }; + ".config/isyncrc" = { + source = builtins.toPath ../../../dotfiles/isyncrc; + recursive = true; + force = true; + }; + ".config/msmtp" = { + source = builtins.toPath ../../../dotfiles/msmtp; + recursive = true; + force = true; + }; + }; + }; +} diff --git a/modules/nix/groups/desktop.nix b/modules/nix/groups/desktop.nix index a0f36d5..54d992b 100644 --- a/modules/nix/groups/desktop.nix +++ b/modules/nix/groups/desktop.nix @@ -31,6 +31,7 @@ in chromium.enable = true; wireshark.enable = true; alacritty.enable = true; + mail.enable = true; }; programs.firefox.enable = true; environment.systemPackages = with pkgs; [ @@ -54,10 +55,6 @@ in arduino-cli firejail qbittorrent - neomutt - pass - isync - msmtp ]; }; } diff --git a/modules/nix/groups/laptop.nix b/modules/nix/groups/laptop.nix index a5dcde3..7e8be93 100644 --- a/modules/nix/groups/laptop.nix +++ b/modules/nix/groups/laptop.nix @@ -36,6 +36,7 @@ in chromium.enable = true; wireshark.enable = true; steam.enable = true; + mail.enable = true; }; programs.firefox.enable = true; @@ -59,10 +60,6 @@ in arduino-ide arduino-cli firejail - neomutt - pass - isync - msmtp ]; }; } diff --git a/modules/nix/networking/default.nix b/modules/nix/networking/default.nix index 735eff3..6f58e2c 100644 --- a/modules/nix/networking/default.nix +++ b/modules/nix/networking/default.nix @@ -3,5 +3,6 @@ imports = [ ./openssh.nix ./wireshark.nix + ./mail.nix ]; } diff --git a/modules/nix/networking/mail.nix b/modules/nix/networking/mail.nix new file mode 100644 index 0000000..2e452c7 --- /dev/null +++ b/modules/nix/networking/mail.nix @@ -0,0 +1,26 @@ +{ + lib, + config, + pkgs, + ... +}: +let + inherit (lib) mkIf mkOption types; +in +{ + options.smayzy.mail.enable = mkOption { + type = types.bool; + default = false; + description = "enables neomut isync and msmtp"; + }; + + config = mkIf config.smayzy.mail.enable { + environment.systemPackages = with pkgs; [ + neomutt + isync + msmtp + pass + ]; + programs.gnupg.agent.enable = true; + }; +}