unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Trev <trev@trevdev.ca>
To: GUIX Help <help-guix@gnu.org>
Subject: Guix home mcron help
Date: Thu, 23 Jun 2022 09:42:29 -0700	[thread overview]
Message-ID: <87tu8bib62.fsf@codinator.mail-host-address-is-not-set> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1546 bytes --]

Hey guys,

I am trying to appreciate how to set up a guix home mcron using a
separate module that I wrote that exports the job.

My config lives in ~/.config/guix/home/config.scm

My cron module lives in ~/.config/guix/home/cron/mailsync.scm

The mailsync module export this:

#+BEGIN_SRC scheme
(define-public %mailsync-job
  #~(job '(next-minute-from
           (next-minute) (range 0 60 15))
         (lambda ()
           (mailsync-update %mailsync-default-terms)
           (mailsync-notify
            (mailsync-count-new-messages)))
         "mbsync-nm-job"))
#+END_SRC

In my home config I am using it like this:

#+BEGIN_SRC scheme
(home-environment
 (packages
  (specifications->packages
   (append %base-packages
           %emacs
           %multimedia
           %browsers
           %chat-clients
           %devel)))
 (services
  (list (service home-mcron-service-type
                 (home-mcron-configuration
                  (jobs (list %mailsync-job)))))))
#+END_SRC

The command =guix home reconfigure ~/.config/guix/home/config.scm= passes without errors but the resulting cron is unhappy when it runs because it has lost scope of the module it came from and can't find =mailsync-update= (or any other definitions from within said module).

I have attempted to implement =with-imported-modules= from within the module and from within my home configuration and am not having much success.

Can I get a push?

Here's a link to the config and module in full: https://gist.github.com/trev-dev/3312444daa75758822c06db5922aac4f


[-- Attachment #1.2: Type: text/plain, Size: 66 bytes --]

-- 

Trev : 0FB7 D06B 4A2A F07E AD5B  1169 183B 6306 8AA1 D206

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

             reply	other threads:[~2022-06-23 20:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 16:42 Trev [this message]
2022-06-25  0:57 ` Guix home mcron help Trev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu8bib62.fsf@codinator.mail-host-address-is-not-set \
    --to=trev@trevdev.ca \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).