From c7595f6468a1bf9a4396c121b487fd643219afed Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Wed, 10 Jul 2024 18:54:39 -0400 Subject: [PATCH] email and others --- hosts/macbook/configuration.nix | 8 ++ hosts/macbook/home.nix | 3 + modules/home-manager/email/default.nix | 102 +++++++++++++++++++---- modules/home-manager/email/mailcap | 1 + modules/home-manager/wezterm/default.nix | 6 +- 5 files changed, 103 insertions(+), 17 deletions(-) create mode 100644 modules/home-manager/email/mailcap diff --git a/hosts/macbook/configuration.nix b/hosts/macbook/configuration.nix index 1f1ae47..5719054 100644 --- a/hosts/macbook/configuration.nix +++ b/hosts/macbook/configuration.nix @@ -44,6 +44,14 @@ cmd - return : wezterm ''; }; + postgresql = { + enable = true; + ensureDatabases = [ "todos" ]; + authentication = pkgs.lib.mkOverride 10 '' + #type database DBuser auth-method + local all all trust + ''; + }; }; home-manager = { diff --git a/hosts/macbook/home.nix b/hosts/macbook/home.nix index 4303c4e..dd4dee9 100644 --- a/hosts/macbook/home.nix +++ b/hosts/macbook/home.nix @@ -10,6 +10,7 @@ ../../modules/home-manager/eza ../../modules/home-manager/bat ../../modules/home-manager/irssi + ../../modules/home-manager/email ]; home.username = "mthomson"; home.homeDirectory = "/Users/mthomson"; @@ -52,6 +53,8 @@ inetutils taskwarrior3 taskwarrior-tui + devenv + _1password ]; programs.home-manager.enable = true; diff --git a/modules/home-manager/email/default.nix b/modules/home-manager/email/default.nix index 58725dd..0f79966 100644 --- a/modules/home-manager/email/default.nix +++ b/modules/home-manager/email/default.nix @@ -2,20 +2,82 @@ { home.packages = with pkgs; [ - protonmail-bridge + w3m + mailcap ]; + home.file.".mailcap".source = ./mailcap; + programs = { - mbsync = { - enable = true; - }; neomutt = { enable = true; + sort = "reverse-date"; + sidebar = { + enable = true; + }; + binds = [ + { + map = [ "index" "pager" ]; + key = "B"; + action = "sidebar-toggle-visible"; + } + { + map = [ "index" "pager" ]; + key = "\\CN"; + action = "sidebar-next"; + } + { + map = [ "index" "pager" ]; + key = "\\CP"; + action = "sidebar-prev"; + } + { + map = [ "index" "pager" ]; + key = "\\CO"; + action = "sidebar-open"; + } + ]; + extraConfig = '' + color normal default default # Text is "Text" + color index color2 default ~N # New Messages are Green + color index color1 default ~F # Flagged messages are Red + color index color13 default ~T # Tagged Messages are Red + color index color1 default ~D # Messages to delete are Red + color attachment color5 default # Attachments are Pink + color signature color8 default # Signatures are Surface 2 + color search color4 default # Highlighted results are Blue + + color indicator default color8 # currently highlighted message Surface 2=Background Text=Foreground + color error color1 default # error messages are Red + color status color15 default # status line "Subtext 0" + color tree color15 default # thread tree arrows Subtext 0 + color tilde color15 default # blank line padding Subtext 0 + + color hdrdefault color13 default # default headers Pink + color header color13 default "^From:" + color header color13 default "^Subject:" + + color quoted color15 default # Subtext 0 + color quoted1 color7 default # Subtext 1 + color quoted2 color8 default # Surface 2 + color quoted3 color0 default # Surface 1 + color quoted4 color0 default + color quoted5 color0 default + + color body color2 default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses Green + color body color2 default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs Green + color body color4 default (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text Blue + color body color4 default (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text Blue + color body color4 default (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text Blue + + color sidebar_flagged color1 default # Mailboxes with flagged mails are Red + color sidebar_new color10 default # Mailboxes with new mail are Green + ''; }; msmtp = { enable = true; }; - notmuch = { + mbsync = { enable = true; }; password-store = { @@ -25,28 +87,36 @@ accounts.email = { accounts.michaelthomson = { + primary = true; address = "michael@michaelthomson.dev"; - imap = { - host = "127.0.0.1"; - port = 1143; + realName = "Michael Thomson"; + userName = "michael@michaelthomson.dev"; + passwordCommand = "op read \"op://Personal/SES SMTP/password\""; + neomutt = { + enable = true; + extraMailboxes = [ "Drafts" "Sent" "Trash" "Junk" ]; }; mbsync = { enable = true; create = "maildir"; }; + imap = { + host = "mail.michaelthomson.dev"; + port = 993; + tls = { + enable = true; + }; + }; msmtp = { enable = true; }; - notmuch = { - enable = true; - }; - primary = true; - realName = "Michael Thomson"; smtp = { - host = "127.0.0.1"; - port = "1025"; + host = "mail.michaelthomson.dev"; + port = 465; + tls = { + enable = true; + }; }; - userName = "michael@michaelthomson.dev"; }; }; } diff --git a/modules/home-manager/email/mailcap b/modules/home-manager/email/mailcap new file mode 100644 index 0000000..8603537 --- /dev/null +++ b/modules/home-manager/email/mailcap @@ -0,0 +1 @@ +text/html; w3m -I %{charset} -T text/html; copiousoutput; diff --git a/modules/home-manager/wezterm/default.nix b/modules/home-manager/wezterm/default.nix index 3a7f820..1596085 100644 --- a/modules/home-manager/wezterm/default.nix +++ b/modules/home-manager/wezterm/default.nix @@ -1,12 +1,16 @@ { pkgs, config, ... }: { + home.packages = with pkgs; [ + iosevka + ]; + programs.wezterm = { enable = true; extraConfig = '' return { color_scheme = 'catppuccin-frappe', - -- font = wezterm.font('PragmataPro Liga'), + font = wezterm.font('Iosevka'), font_size = 16, use_fancy_tab_bar = false, native_macos_fullscreen_mode = false,