From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4KOiAUs2xF+9agAA0tVLHw (envelope-from ) for ; Mon, 30 Nov 2020 00:01:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4Ab+OEo2xF8dYAAAbx9fmQ (envelope-from ) for ; Mon, 30 Nov 2020 00:01:14 +0000 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 DB06A9403EC for ; Mon, 30 Nov 2020 00:01:13 +0000 (UTC) Received: from localhost ([::1]:42646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjWcy-0008CZ-5x for larch@yhetil.org; Sun, 29 Nov 2020 19:01:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjWcB-0008CM-O7 for Help-Guix@gnu.org; Sun, 29 Nov 2020 19:00:23 -0500 Received: from box.euandre.org ([46.101.160.115]:50283) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjWc8-0001wl-Em for Help-Guix@gnu.org; Sun, 29 Nov 2020 19:00:23 -0500 Received: from authenticated-user (box.euandre.org [46.101.160.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.euandre.org (Postfix) with ESMTPSA id A1980FC3DB; Sun, 29 Nov 2020 21:00:13 -0300 (-03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=euandre.org; s=mail; t=1606694414; bh=7UD8J4TXQAs7gmCWth52pItPJ3JEU+c0bgWcueVUNOs=; h=From:To:Cc:Subject:Date:From; b=tEiLl+6Z6qF7bFeS7sfm801dgclXsfKd/ydvqH0Z0Sll9slJdUnZTAAAS0H4GVQQb 6Mbv+7zeUt9mGBYrXUOaawKL0ha9hvLypBDf11Q0af65VN8sTOD5yuxgwVbiTYd81J vveMzaM2pQ7tIfo8bUMcnNc5hiKPc10gizGy6Lm3hSgVzFpkRy9ZMUHTiQYWRdQuuM WOMyTybxHAVwSwiyhYLkAe5nn70l0FlXpT9pJjhH1LLSmXWPgjEhGtGr/zWMxna2pb tkv4QEoNR57xze9BsUo90TCwwLRMN6xKcqfom9lePBaD8c7sFSkq8m8ZWmuLXRZYUq qVDj1LJi/d92Q== From: EuAndreh To: help-guix Cc: Subject: How to call a local function from a mcron job? Date: Sun, 29 Nov 2020 20:58:23 -0300 Message-ID: <87czzvn2ao.fsf@euandre.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=46.101.160.115; envelope-from=eu@euandre.org; helo=box.euandre.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 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-Spam-Score: -1.98 X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=euandre.org header.s=mail header.b=tEiLl+6Z; dmarc=pass (policy=quarantine) header.from=euandre.org; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-TUID: iHNxh1NRb7CL Hi Guix! I wrote a Guile function that works like a script that take no arguments and interacts with the filesystem, something like: (define (my-fn) ...) It is a wrapper over other functions defined in the same file, and calls them in the right order. Then I wanted to make this function run as a mcron job, and I tried: (define my-fn-job #(job "* * * * *" my-fn)) But that doesn't work. At reconfigure time, Guix complains about not knowing the variable 'my-fn': Unbound variable: my-fn I tried wrapping it in a '(with-imported-modules ...)' call, but the code isn't in a module, but in the same file. I guess that putting all my code from 'my-fn' and all the functions it calls inlined in a lambda in the job definition would solve it, but it feels wrong to me. Is there a way to reference it from the job, without embedding all the scheme code in the job definition?