From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EDeEL5NdtmJvogAAbAwnHQ (envelope-from ) for ; Sat, 25 Jun 2022 02:57:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wIuFLpNdtmJaAwAAG6o9tA (envelope-from ) for ; Sat, 25 Jun 2022 02:57:55 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 621B99ED0 for ; Sat, 25 Jun 2022 02:57:54 +0200 (CEST) Received: from localhost ([::1]:34024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4u7U-00035j-Id for larch@yhetil.org; Fri, 24 Jun 2022 20:57:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4u7F-00033e-LB for help-guix@gnu.org; Fri, 24 Jun 2022 20:57:37 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:46049) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4u7D-0000uT-B0 for help-guix@gnu.org; Fri, 24 Jun 2022 20:57:37 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id D503C32004CE for ; Fri, 24 Jun 2022 20:57:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 24 Jun 2022 20:57:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trevdev.ca; h=cc :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1656118651; x=1656205051; bh=U1Y+MrW9cn OnEBN2OqIs1Zlu3x20iudgRTGCjG4FZ10=; b=CHgaFvThxF0YrznoBtLdhYqNUv 9k3CS1eCtbuYOW7r5Ak89NE4dNZCozQtlkFzeWh8YchP81zuwRq9+T5kuH/BT2le sLrTTd109e/BArgobkZVVsH7/jqTRnGE5SNfjxtg1sGbwwsyJ19b11yYCqGlu2id /MaunR0lBoOCqVwfOnmoV6fgfyK/xP8tlVEx0Xx94um3b0xQC0jZZB6Ya1BJ8JyU abPRD2xbyw7e0JkEYExrguf5WvEauAnLFzhIb8hdSY6KQeMkXomS/n+9Nb6iFis/ CWxmj9AiysfNg8jKvTogJjmCY2tCdDOsJvH3BKN35UhAbw37hRrS0kzBiiLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1656118651; x=1656205051; bh=U1Y+MrW9cnOnEBN2OqIs1Zlu3x20 iudgRTGCjG4FZ10=; b=OU5FfFh8Ps4SHhYz2/ek3nBQusN1zptc+jOLoS8VI+Kz 5uPInKyPUNarNpJRtsYCXGk6WOFcTYK1x7N3hOv3nGUqNETktRKYx763xcnvLqog ZDLrtsMV/L0XuU/wn5O2PLmjwkg8rUDaGD9YJYGJvBXJx3qVFAzCa06SqzzAWTNE 1rkddMkSUa0+YN/hEUocJsQS9os01hzhS3eoqGHopZvaEebFsvdxyUu89PoFO3Qs k6Ws/1Qh14+cRwKt3mZzPPOyiwIDQDUqVAXbd8IEFuHtE0i1NkHC+cFC9Vntm/Yk C4ys8I+aHL0FTQi5otnRaUdaTVjc27kJb5k/VC3XYA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudegtddggeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhffkfggtgesghdtreertddttdenucfhrhhomhepvfhrvghvuceo thhrvghvsehtrhgvvhguvghvrdgtrgeqnecuggftrfgrthhtvghrnhepveehheejgfekvd egveevvdekhfdujeevhedvgeehfeeftdfgjeevffdvjeegkeeunecuffhomhgrihhnpehp rghsthgvsghinhdrtghomhdpghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepthhrvghvsehtrhgvvhguvghvrdgtrg X-ME-Proxy: Feedback-ID: i762946f9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 24 Jun 2022 20:57:30 -0400 (EDT) From: Trev To: GUIX Help Subject: Re: Guix home mcron help In-Reply-To: <87tu8bib62.fsf@codinator.mail-host-address-is-not-set> References: <87tu8bib62.fsf@codinator.mail-host-address-is-not-set> Date: Fri, 24 Jun 2022 17:57:25 -0700 Message-ID: <87tu89zhje.fsf@codinator.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=64.147.123.20; envelope-from=trev@trevdev.ca; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656118675; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=U1Y+MrW9cnOnEBN2OqIs1Zlu3x20iudgRTGCjG4FZ10=; b=G57YTX7PG86uIG2KMJy6efqYt9+P9Z7qSABrTQgIQlRMJGE2LhNLIqLpFiWTUTjVIHmmWo 0OpBJj1yrd7+9CDX1T2epswC9L1S68K5W7nd2AX16+yeEVPuDyxDO8afntEyneHEeJOtcX cGETr7+fnpyeMEJJAgWu9JU3Q21E+M8WOP3jE/+CsfAZ/NmxCgMgkYZ4uDUhAujxPs1cCv QjAj3X1L/256HNrEDeJQbnAUEaIjiN1iGcWw387oYJeE/VmAzUBWFVYNB8TFIVmSfcDl2W rzSMOviP9Gpl/ncuf8JGRoZAwTXP0tSpDZytLjXyC9srwej1rey2ABUvkSwnXA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656118675; a=rsa-sha256; cv=none; b=H20KpPU/Lh+eCLXnu1D2HMJyOMn/ijnLoVGNqcuk40GbgnlEsEd2sxbBVY2PZe25T2mXz+ dI5B5XxmnW9eN9elfE0YO3NG8qcSJarMwBTe6TbTWzKiwdxjVnanRCOydeZBZ8W+eiMfAe cP5BxeEbD40DUZlpr5gS7WEG6gi2eNZZiQIeUGKEYSHaAACn0jYd4OidDmejdoCo7Ux+Q/ kziU5Ab8D7SibgNqGtEptBLAba1Jfb6ACKpouK/ZT29bmHZm2zu8gnvwoU/ldVyyBqaofq lxWcoy9Yp93MNPrkNHoNuAzaZdyR1K5hykjS5CxcdcjERrKZDn4gBXGUmchfOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trevdev.ca header.s=fm3 header.b=CHgaFvTh; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=OU5FfFh8; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.76 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trevdev.ca header.s=fm3 header.b=CHgaFvTh; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=OU5FfFh8; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 621B99ED0 X-Spam-Score: -1.76 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9fU2fkkoLOoM --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Quick update: I was able to get my mcron working in a way that seems to be the proper "guix home" way. It just took a lot of re-reading, trial & error. The downside to my solution is that I had to wrap my entire mailsync module in a #~(job #$(program-file)) gexp. Here's an example of my solution: https://pastebin.com/f12mvpUz I hate to admit that I struggled a lot with the documentation for what a gexp is, how they're meant to be implemented, and what a (job) procedure will allow given the context of a guix home service. For example, I couldn't figure out how to store my module & an image file in the guix store so that I could thereafter load and run the file with a command such as `guile -s` as the cron job. Or better yet, load the = module with `use-modules` from the "program-file" and run the exported functions. Anyway, I am open to feedback/suggestions. Thanks for reading this :) Trev writes: > Hey guys,=20 > > I am trying to appreciate how to set up a guix home mcron using a separat= e module that I wrote that exports the job.=20 > > My config lives in ~/.config/guix/home/config.scm=20 > > My cron module lives in ~/.config/guix/home/cron/mailsync.scm=20 > > The mailsync module export this:=20 > > (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")) > > In my home config I am using it like this:=20 > > (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))))))) > > The command guix home reconfigure ~/.config/guix/home/config.scm passes w= ithout 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 mails= ync-update (or any other definitions from within said module).=20 > > I have attempted to implement with-imported-modules from within the modul= e and from within my home configuration and am not having much > success.=20 > > Can I get a push?=20 > > Here's a link to the config and module in full: https://gist.github.com/t= rev-dev/3312444daa75758822c06db5922aac4f=20 > --=20 > > Trev : 0FB7 D06B 4A2A F07E AD5B 1169 183B 6306 8AA1 D206 =2D-=20 Trev : 0FB7 D06B 4A2A F07E AD5B 1169 183B 6306 8AA1 D206 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYIAC4WIQTXT7EGCbVt/Iwh9m+FRs+EoT3V7wUCYrZddRAcdHJldkB0cmV2 ZGV2LmNhAAoJEIVGz4ShPdXv0TUA/1YYUvwmWRQ4G5csnO32BO+CMAAvjtf396r1 cu9hC8JRAQC33FbRAJSr+a2jiE/uQSjtKNbETE+Yh30ju4WgpaVjCA== =6AtA -----END PGP SIGNATURE----- --=-=-=--