From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id SA8CM9kFcmbCYgEAe85BDQ:P1 (envelope-from ) for ; Tue, 18 Jun 2024 22:10:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id SA8CM9kFcmbCYgEAe85BDQ (envelope-from ) for ; Wed, 19 Jun 2024 00:10:33 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=SpgcITsd; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718748633; a=rsa-sha256; cv=none; b=Ld2YctzZOO7bPMSrkzZHlNspyHVX0Mdb12HkmJlMi2sARTgAncxTAxi0x8w0DjC4vRFLMF n9eASNuDFCShWlzdJb6eQZ2qXGwqegchQSIb9GHgID82025f98RDj+zvDSs0KOXnIghwoe nOtlRF5YVzFKeIQVf+uYEE1r+nabPwvgM2zXJwGhlpJIcIZ+ceuNHFVfP3z+856VbYiCBY J50LRr/6KoH6og5MCUBFTAJkNqffCFHkaWVPzmftGk3de9gXvvPUX6rq1DtOKkpyXjYLpd JXZej92N9eN/N8BSiooVpFrjaZ48tpqFdp9qpz3MPihcIlPKaPLMChE0mmO8Fg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=SpgcITsd; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718748633; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Kp6UdaLafZCtMHopLCdbgRcFxUwyYsOPiJ26k1B1Afw=; b=BBMy7YOXC826i31gBfCQrf+c/JXaU+PhgtebEDvvpUIl8hHnal8ilsLhndA/+w0ZC7avYF 66IEAYJek0OXjDKQ/2PFoFR6RQTm6BQBDxHBgGomuWhBAtWdcPLjIKv/NRVZVqar5FMkqf oBAk3SyTOXDmgkqHzOKiNS4+bW1NLB8iY0hrWlrVzxj+0K/oWAQuTanE9howRmat5cvqCg d4bgzGPGcWZGob2jGQmHMBzKNnarJVSbwsC5HaQx5xRxAAniKmguYUDJvg+lvajdEjV9QS JTmfXWKI3Wg9UJ8yEc1qeBnN+cmLYWRgWwTpixZiz/Ul+qaHFWopN9M9UzKSZQ== 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 7995264FEB for ; Wed, 19 Jun 2024 00:10:33 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJh1g-0005iq-NS; Tue, 18 Jun 2024 18:10:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJh1e-0005hc-7i for guix-patches@gnu.org; Tue, 18 Jun 2024 18:10:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJh1d-0003CI-UP; Tue, 18 Jun 2024 18:10:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJh1e-00034b-UI; Tue, 18 Jun 2024 18:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71639] [PATCH WIP 3/5] services: backup: Add extra-packages field to restic-backup-job Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, ludo@gnu.org, matt@excalamus.com, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 18 Jun 2024 22:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71639 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71639@debbugs.gnu.org Cc: ludo@gnu.org, Richard Sent , goodoldpaul@autistici.org, Florian Pelz , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Matthew Trzcinski , Maxim Cournoyer X-Debbugs-Original-Xcc: Florian Pelz , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Matthew Trzcinski , Maxim Cournoyer Received: via spool by 71639-submit@debbugs.gnu.org id=B71639.171874857211685 (code B ref 71639); Tue, 18 Jun 2024 22:10:02 +0000 Received: (at 71639) by debbugs.gnu.org; 18 Jun 2024 22:09:32 +0000 Received: from localhost ([127.0.0.1]:53633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJh19-00032M-8d for submit@debbugs.gnu.org; Tue, 18 Jun 2024 18:09:31 -0400 Received: from mail-108-mta114.mxroute.com ([136.175.108.114]:46741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJh17-000326-T6 for 71639@debbugs.gnu.org; Tue, 18 Jun 2024 18:09:30 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta114.mxroute.com (ZoneMTA) with ESMTPSA id 1902d65cb7500017a3.002 for <71639@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 18 Jun 2024 22:09:24 +0000 X-Zone-Loop: e96ab436a84f242ce19376eba8c7f147e44e6d00a06e X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Kp6UdaLafZCtMHopLCdbgRcFxUwyYsOPiJ26k1B1Afw=; b=SpgcITsdGm3r5gcBqaOitpwRi2 /8gtq6NnK8WTQLLOfF0Xg4d4WxYZDEC/J6PhAoMrhvDiub3k0YC+czTk+7ao3Si0EmZ9vPTP0AGid mx6slmzgS73OnbqWhL92Y9jUCJhaWZWk5hubvdZJlNu4CFeuxIQRzR++jhOUUuoHA+PtmHNOz5oZP XwNkbU+AKJiH4Y3gS4ECjC/4HTRqE7PAO42u7AsP/9rhM2Cv+ypsdbolt7yFLWDUwIyPllFGs9vyM 1Zj0Ftx2OFtedJ7JYxMup/M4DHxQWMDR39VkDfiSHFVOX2o7ogA6RGqV6UkQbowdz56/MJIRHr88c +NGOyytQ==; From: Richard Sent Date: Tue, 18 Jun 2024 18:08:50 -0400 Message-ID: <146d362c149771810d673e927b56d3ec44bc9bba.1718747513.git.richard@freakingpenguin.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.36 X-Migadu-Scanner: mx12.migadu.com X-Spam-Score: -3.36 X-Migadu-Queue-Id: 7995264FEB X-TUID: ymzf9mx3f7X0 * gnu/services/backup.scm (restic-backup-job): Create extra-packages. (restic-guix-wrapper-package): Add the extra-packages field of every job as inputs. * doc/guix.texi (Miscellaneous Services): Document it. Change-Id: I4f0b070bc6dc895553ba69256d14e45898291c02 --- doc/guix.texi | 4 ++++ gnu/services/backup.scm | 33 ++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f22d679023..32ce0c86b9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -41367,6 +41367,10 @@ Miscellaneous Services @item @code{verbose?} (default: @code{#f}) (type: boolean) Whether to enable verbose output for the current backup job. +@item @code{extra-packages} (default: @code{'()} (type: list-of-packages) +The list of extra packages needed for restic to run the current backup +job. + @item @code{extra-flags} (default: @code{'()}) (type: list-of-lowerables) A list of values that are lowered to strings. These will be passed as command-line arguments to the current job @command{restic backup} diff --git a/gnu/services/backup.scm b/gnu/services/backup.scm index 2471d0ea7b..a6d8404a5a 100644 --- a/gnu/services/backup.scm +++ b/gnu/services/backup.scm @@ -41,6 +41,7 @@ (define-module (gnu services backup) restic-backup-job-files restic-backup-job-init? restic-backup-job-verbose? + restic-backup-job-extra-packages restic-backup-job-extra-flags restic-backup-configuration @@ -102,6 +103,9 @@ (define-configuration/no-serialization restic-backup-job (list-of-lowerables '()) "The list of files or directories to be backed up. It must be a list of values that can be lowered to strings.") + (extra-packages + (list-of-packages '()) + "The list of extra packages needed for restic to run this backup job.") (verbose? (boolean #f) "Whether to enable verbose output for the current backup job.") @@ -239,22 +243,25 @@ (define (restic-backup-job->mcron-job config) #:user #$user))) (define (restic-guix-wrapper-package jobs) - (package - (name "restic-backup-service-wrapper") - (version "0.0.0") - (source (restic-guix jobs)) - (build-system copy-build-system) - (arguments - (list #:install-plan #~'(("./" "/bin")))) - (home-page "https://restic.net") - (synopsis - "Easily interact from the CLI with Guix configured backups") - (description - "This package provides a simple wrapper around @code{restic}, handled + (let ((extra-packages (append-map restic-backup-job-extra-packages + jobs))) + (package + (name "restic-backup-service-wrapper") + (version "0.0.0") + (source (restic-guix restic-package jobs)) + (build-system copy-build-system) + (arguments + (list #:install-plan #~'(("./" "/bin")))) + (home-page "https://restic.net") + (synopsis + "Easily interact from the CLI with Guix configured backups") + (description + "This package provides a simple wrapper around @code{restic}, handled by the @code{restic-backup-service-type}. It allows for easily interacting with Guix configured backup jobs, for example for manually triggering a backup without waiting for the scheduled job to run.") - (license license:gpl3+))) + (inputs extra-packages) + (license license:gpl3+)))) (define restic-backup-service-profile (lambda (config) -- 2.45.1