From 0ec583d64fb7640611f5e2d440c75a1b8b86f8f5 Mon Sep 17 00:00:00 2001 From: Leonardo Santiago Date: Mon, 5 May 2025 23:34:15 -0300 Subject: chore(home-manager): improve home-manager structuring --- modules/home/mu.nix | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 modules/home/mu.nix (limited to 'modules/home/mu.nix') diff --git a/modules/home/mu.nix b/modules/home/mu.nix new file mode 100644 index 0000000..1a22963 --- /dev/null +++ b/modules/home/mu.nix @@ -0,0 +1,66 @@ +{ config, lib, ...}: with lib; let + cfg = config.santi-modules; +in { + options.santi-modules.mu.enable = mkEnableOption "Enables mu, mbsync and msmtp"; + config = mkIf cfg.mu.enable { + home-manager.users.leonardo = { + programs = { + mu.enable = true; + msmtp.enable = true; + mbsync.enable = true; + }; + services.mbsync = { + enable = true; + frequency = "*:0/5"; + }; + accounts.email.accounts = { + personal = { + address = "leonardo.ribeiro.santiago@gmail.com"; + userName = "leonardo.ribeiro.santiago@gmail.com"; + imap.host = "imap.gmail.com"; + smtp.host = "smtp.gmail.com"; + primary = true; + realName = "Leonardo Ribeiro Santiago"; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + }; + msmtp.enable = true; + mu.enable = true; + passwordCommand = "cat ${config.age.secrets.personal-mail.path}"; + }; + university = { + address = "leonardors@dcc.ufrj.br"; + userName = "leonardors@dcc.ufrj.br"; + imap.host = "imap.gmail.com"; + smtp.host = "smtp.gmail.com"; + realName = "Leonardo Ribeiro Santiago"; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + }; + msmtp.enable = true; + mu.enable = true; + passwordCommand = "cat ${config.age.secrets.university-mail.path}"; + }; + work = { + address = "leonardo@mixrank.com"; + userName = "leonardo@mixrank.com"; + imap.host = "imap.gmail.com"; + smtp.host = "smtp.gmail.com"; + realName = "Leonardo Ribeiro Santiago"; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + }; + msmtp.enable = true; + mu.enable = true; + passwordCommand = "cat ${config.age.secrets.work-mail.path}"; + }; + }; + }; + }; +} -- cgit v1.2.3