unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* A Guix Home service to group together various email services
@ 2024-07-01 16:57 Fabio Natali
  2024-07-01 22:12 ` Richard Sent
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Natali @ 2024-07-01 16:57 UTC (permalink / raw)
  To: help-guix

Hi. 👋

I'd like to define a Guix Home service that aggregates all my email
configuration together: mbsync, msmtp, Notmuch, and a couple of mcron
jobs.

So far, I've kept them as separate services but I thought it was nice
and cleaner having them grouped together.

I've been thinking of something along the lines of:

(define my/msmtp-config
  (list
   (msmtp-account
    (name "test")
    (configuration
     (msmtp-configuration
      (host "example.com")
      (user "user")
      ...)))
   ...))

(define my/home-email-service
  (service
   (service-type
    (name 'home-email)
    (extensions
     (list
      (service-extension home-mcron-service-type (const ...))
      (service-extension home-msmtp-service-type (const my/msmtp-config))
      (service-extension home-xdg-configuration-files-service-type (const ...))))
    (default-value #f)
    (description "Email service."))))

This mostly works:

- 'guix home reconfigure' runs smoothly, without warning or error.
- mbsync and Notmuch configuration files are correctly created.
- Guix Home cron jobs are also defined as expected.

However, msmtp is not configured correctly. The resulting file
'~/.config/msmtp/config' only contains the string 'defaults'.

I can successfully set up msmtp as a separate service like this:

(define my/home-msmtp-service
  (service
   home-msmtp-service-type
   (home-msmtp-configuration (accounts my/msmtp-config))))

Anything that you think I'm doing wrong here? Could it be a limitation
with 'home-msmtp-service-type', which doesn't seem to indicate any
mechanism for extend/compose?

More generally, this way of aggregating services together in
'my/home-email-service', does it look like a good pattern or should I do
things any differently?

Thanks, cheers, Fabio.


-- 
Fabio Natali
https://fabionatali.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-02 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 16:57 A Guix Home service to group together various email services Fabio Natali
2024-07-01 22:12 ` Richard Sent
2024-07-02 10:24   ` Fabio Natali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).