From patchwork Tue Jun 18 22:08:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sent X-Patchwork-Id: 65482 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id ED00D27BBE9; Tue, 18 Jun 2024 23:10:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 81DC927BBF3 for ; Tue, 18 Jun 2024 23:10:32 +0100 (BST) 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 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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)