help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A Guix Home service to group together various email services


From: Fabio Natali
Subject: A Guix Home service to group together various email services
Date: Mon, 01 Jul 2024 17:57:06 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]