From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iMKoLyQ682XBRQEAqHPOHw:P1 (envelope-from ) for ; Thu, 14 Mar 2024 18:55:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id iMKoLyQ682XBRQEAqHPOHw (envelope-from ) for ; Thu, 14 Mar 2024 18:55:48 +0100 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=dwiNSHK1; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1710438948; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ux5P1VZ9gbvWZeXhoUehDxtZTs04ltKO8EW8l06MGo0=; b=nJoHvy78xA7b3i7Pa8wGlnl1xQD1xRMwuHvHFryVicSYh/tm2duhS7R3aWZs0SuOc5WizF n3Z01DajPo5WUku+K3tZBrQE00BBEHIvQI3Ps9U+XgMCis0A1LpDJDKEH/EeDyx1wUjBnQ oE+D3rOXyplpjiGFSau/Gza2lEhQ2+7vh5hrT9Hxu8eHjm/AWLkscsMMOqan42h0KwCTsB kvIA1m/lz3eBe1xbYGl8P08Jv+IkS8iW1HZY5+Kiv5bsQRispBo6pqbmyULzFzjatw6Tb0 23VRhpS7g1KU3uLHHlDeqT71wbg6eIu37CCchNnew8rlTfoGUNzTdbfcZc5eAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=dwiNSHK1; 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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710438948; a=rsa-sha256; cv=none; b=EcRpae9BY1d3rIoux4F1ZAUTs6CQ2rJY+qkaDDSiBsmGwLhFTKbw+HDJQGA3RAbtjRlmTX zsBo1UuD15Ab1nvCX7iD39YNFqdLHngQqWKXH06y7q+u4UNhqJd9xdxOhss3ZjgsJVZZMl zr3JMy/ZG9xik20oQ1Gz6eiGxyFmzMzZiw3UrfgyXHCsZ3UxXoVFooOxfbNiLLa8ceQ4wJ y273mgreGxOl/v5J4okZGRRAcE5qZ1XsqbKVQmXMDfyXkugxplpLyD07WZgEh5F/904G82 hDLbxa+1lOmE01v0ff51GXNvoa9TckbRUtLCBRB4ZXwa5qICtXCIQ5ZH8S0GZQ== 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 80DED3FE72 for ; Thu, 14 Mar 2024 18:55:48 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rkpIU-0004v6-4N; Thu, 14 Mar 2024 13:55:18 -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 1rkpIO-0004tc-IX for help-guix@gnu.org; Thu, 14 Mar 2024 13:55:12 -0400 Received: from mail-108-mta130.mxroute.com ([136.175.108.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rkpIJ-00050d-09 for help-guix@gnu.org; Thu, 14 Mar 2024 13:55:10 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta130.mxroute.com (ZoneMTA) with ESMTPSA id 18e3e1a6d4f0003bea.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 14 Mar 2024 17:55:03 +0000 X-Zone-Loop: 2f694cacbcb9bcb6cda6dcfecc487eae255f1a71f5a9 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding: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=ux5P1VZ9gbvWZeXhoUehDxtZTs04ltKO8EW8l06MGo0=; b=dwiNSHK1vK4ShJBL/00DAuHON+ 6fp9PjJo43w4gO4+SthrH2w9n4jbNh27/izrGNl9Nkeen2AWYHACoeFrkdq8j59AGGXq1SVKXZNbS Q93Wo1XxFH97E3sPCwWzHSbSUJ6Zt9LtRtYFz/lHoK16swbGbyW12zY46vJG/O0/KtdOHGuVwSSaL g/xIMML2IgROTYNrHw7f9kZwcXAQV0kPQjZ0aDYPeneAOFLSHQwCLPa9+1PN8BIwCpe84sBv6uTqm DuedFmkImEGc+uGvq2zdsUZ9c1i/6N6v7ycLwtd6qW7Zfqf3DIK3myRx/DkBYaCGIyFI/87c4k/La Y3vegUwA==; From: Richard Sent To: Remco van 't Veer Cc: Oleg Pykhalov , help-guix Subject: Re: add shepherd requirement to an existing service? In-Reply-To: <878r2n21dd.fsf@remworks.net> (Remco van t. Veer's message of "Tue, 12 Mar 2024 11:25:18 +0100") References: <87v85t112q.fsf@remworks.net> <87wmq8lhm7.fsf@gmail.com> <878r2n21dd.fsf@remworks.net> Date: Thu, 14 Mar 2024 13:54:54 -0400 Message-ID: <87ttl8wvf5.fsf@freakingpenguin.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.130; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta130.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.36 X-Spam-Score: -2.36 X-Migadu-Queue-Id: 80DED3FE72 X-Migadu-Scanner: mx13.migadu.com X-TUID: 9Q1BlnWkBPHZ If this winds up being something you do frequently, it may be possible to write a function to modify the service type. See [1] as an example. I suspect your code would be smaller, something like --8<---------------cut here---------------start------------->8--- (define (depend-on type new-requirement) "Returns a @code{service-type} record derived from @var{type} with any shepherd extensions additionally depending on @var{new-requirement}." (service-type (inherit type) (extensions (map (lambda (extension) (let ((target (service-extension-target extension)) (compute (service-extension-compute extension))) (if (eq? target shepherd-root-service-type) (service-extension shepherd-root-service-type (lambda (config) (map (lambda (service) (shepherd-service (inherit service) (requirement (cons* new-requirement (shepherd-service-requirement config))))) (compute config)))) extension))) (service-type-extensions type))))) --8<---------------cut here---------------end--------------->8--- This code might not be it exactly, but something similar to this /should/ work. [1] https://git.sr.ht/~freakingpenguin/rsent/tree/master/item/channel/rsent/utils/services.scm -- Take it easy, Richard Sent Making my computer weirder one commit at a time.