all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 59197@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#59197] [PATCH 1/3] services: shepherd: Define 'shepherd-configuration-action' helper.
Date: Fri, 11 Nov 2022 19:12:44 +0100	[thread overview]
Message-ID: <20221111181246.4217-1-ludo@gnu.org> (raw)
In-Reply-To: <20221111181131.4171-1-ludo@gnu.org>

* gnu/services/shepherd.scm (shepherd-configuration-action): New
procedure.
---
 gnu/services/shepherd.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 7110e5aa89..b2601c0128 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -66,6 +66,8 @@ (define-module (gnu services shepherd)
             shepherd-action-documentation
             shepherd-action-procedure
 
+            shepherd-configuration-action
+
             %default-modules
 
             shepherd-service-file
@@ -333,6 +335,16 @@ (define shepherd&co
                      #:options '(#:local-build? #t
                                  #:substitutable? #f)))))
 
+(define (shepherd-configuration-action file)
+  "Return a 'configuration' action to display FILE, which should be the name
+of the service's configuration file."
+  (shepherd-action
+   (name 'configuration)
+   (documentation "Display the name of this service's configuration file.")
+   (procedure #~(lambda (_)
+                  (format #t "~a~%" #$file)
+                  #$file))))
+
 (define (shepherd-configuration-file services shepherd)
   "Return the shepherd configuration file for SERVICES.  SHEPHERD is used
 as shepherd package."
-- 
2.38.0





  reply	other threads:[~2022-11-11 18:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 18:11 [bug#59197] [PATCH 0/3] Support 'herd configuration SERVICE' to view config file Ludovic Courtès
2022-11-11 18:12 ` Ludovic Courtès [this message]
2022-11-11 18:12   ` [bug#59197] [PATCH 2/3] services: Add Shepherd 'configuration' action to various services Ludovic Courtès
2022-11-11 18:12   ` [bug#59197] [PATCH 3/3] home: services: redshift: Add 'configuration' action Ludovic Courtès
2022-11-14  2:16 ` [bug#59197] [PATCH 0/3] Support 'herd configuration SERVICE' to view config file 宋文武 via Guix-patches via
2022-11-18 14:52   ` bug#59197: " Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=20221111181246.4217-1-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=59197@debbugs.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.