From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id GPIvG80L0GSAWwAASxT56A (envelope-from ) for ; Sun, 06 Aug 2023 23:08:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AG0xG80L0GTf6gAA9RJhRA (envelope-from ) for ; Sun, 06 Aug 2023 23:08:29 +0200 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 29C5746522 for ; Sun, 6 Aug 2023 23:08:29 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="K/EfFxnD"; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691356109; 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: 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=/Btq3TtWdV19hY1AtBQ5dUB+m9VRSrUjVIlM9vD5JuI=; b=JPvpW/p4fJCgVGI9bO+XO1OSWUVcj08tjT4LQWdcRv787TCh8Buk/Ft9CLfHNpd0k2yrJK dBpJ9dRHWKa4QT8i2CSc3e837CW/wYtnS6vNgeMVI4jB8/hQegdzq4kpSQQHxRpAz7v/Fo fMaCRNq/STkrPtHm6/2kmYROkWDYBWSlXDv7/UvX9crOSFHBlQxb64wbtxqNw2Q5bP5pv8 jmQ/gJEb0MFs3udkwaDIGiOQYdKuX9zG8CxSviYP8aJwkYYuLgLDOMuFROWrqdeiH9XPhp lbK2PecBnMyGm17E1tJDja0bIIoT2vct7xQ3/mtBLWaacv+E4ZeH9Vj7YKajrQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="K/EfFxnD"; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691356109; a=rsa-sha256; cv=none; b=T3r/iRAkSzvuPrs7CbYfPMlBmZzXG4RLWtam7DemomthVqZXdo6kNzBMhrs4JO9fXnMR7H KS7E8+jrvHET8q/Dstuz5/7UbuBLZSllBMfyU0cYoa+YIcoNp0GWbGjaNORYRRMULkJUDM QxWRskzX7RmVB1jypWhtYUj8CIX0bHFmTrQUQ1U0g2fLQKw6RMdfzRZpdyY5hjSCbDwLUP FkTgymQ6nZIiTDxKEBgr3d9ZWzy3xzpn21curJv+sUeBFljPJVj6L3tteXpNw4k/wNhGnC 7dZIi7KdpbHqo8dGhcHvNy1wpTBti8DxhEGRV0ryCNLbY676DIykofg8EK7+qQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSkyt-0006vk-1E; Sun, 06 Aug 2023 17:08:07 -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 1qSkyr-0006v2-1B for guix-patches@gnu.org; Sun, 06 Aug 2023 17:08:05 -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 1qSkyq-0001T6-Pd for guix-patches@gnu.org; Sun, 06 Aug 2023 17:08:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qSkyq-0005ik-Ko for guix-patches@gnu.org; Sun, 06 Aug 2023 17:08:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65119] [PATCH 4/8] services: Define 'for-home'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Aug 2023 21:08:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65119 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65119@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 65119-submit@debbugs.gnu.org id=B65119.169135608221951 (code B ref 65119); Sun, 06 Aug 2023 21:08:04 +0000 Received: (at 65119) by debbugs.gnu.org; 6 Aug 2023 21:08:02 +0000 Received: from localhost ([127.0.0.1]:60125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSkyn-0005hi-EI for submit@debbugs.gnu.org; Sun, 06 Aug 2023 17:08:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSkyl-0005gm-0A for 65119@debbugs.gnu.org; Sun, 06 Aug 2023 17:07:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSkyf-0001Ng-Qj; Sun, 06 Aug 2023 17:07:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=/Btq3TtWdV19hY1AtBQ5dUB+m9VRSrUjVIlM9vD5JuI=; b=K/EfFxnDnHlVLFwt4LzJ eEW7h/wVS1sep8voj0j0pz5I2NVwDtol2+EDHBvOnyGkG3YFtTX4DlRkGwEnryZZPnTK3Yff0bQuv UzOCP9g2Yu2UWQvLDTfBKD2ny0Wxgdr4cqbBhG7LaYTV53CqtTfbILpt2IYMULIHpi1dkDWdW9Zy2 AclULHn+oe4dyOCfj0v9vVOPxR9+20UwHsOn+dB0A7O5cVupgczoDenhEjlFT0hAXZznbu3BeCkYD tIxKvqBgLJQyBYRco7tJCG0Fq7GrCOfysV9yPFGNFL/kdw37ZSqo3MCXEfz3WSsuYWpYu+b73HJsb qSDfCcdmn3hqFw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sun, 6 Aug 2023 23:07:31 +0200 Message-ID: <55a8ef59696bd6f80da9e1bc5f8ca940df11eda6.1691355218.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-Queue-Id: 29C5746522 X-Migadu-Scanner: mx1.migadu.com X-Spam-Score: -4.36 X-Migadu-Spam-Score: -4.36 X-TUID: ssElz8PkLviN * gnu/services.scm (remove-service-extensions): New procedure. (for-home?): New syntax parameter. (for-home): New macro. --- gnu/services.scm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gnu/services.scm b/gnu/services.scm index 109e050a23..eb9258977e 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015-2022 Ludovic Courtès +;;; Copyright © 2015-2023 Ludovic Courtès ;;; Copyright © 2016 Chris Marusich ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020, 2021 Ricardo Wurmus @@ -86,6 +86,10 @@ (define-module (gnu services) instantiate-missing-services fold-services + remove-service-extensions + for-home + for-home? + service-error? missing-value-service-error? missing-value-service-error-type @@ -1225,4 +1229,23 @@ (define* (fold-services services (G_ "more than one target service of type '~a'") (service-type-name target-type))))))))) +(define (remove-service-extensions type lst) + "Return TYPE, a service type, without any of the service extensions +targeting one of the types in LST." + (service-type + (inherit type) + (extensions (remove (lambda (extension) + (memq (service-extension-target extension) lst)) + (service-type-extensions type))))) + +(define-syntax-parameter for-home? + ;; Whether the configuration being defined is for a Home service. + (identifier-syntax #f)) + +(define-syntax-rule (for-home exp ...) + "Mark EXP, which typically defines a service configuration, as targeting a +Home service rather than a System service." + (syntax-parameterize ((for-home? (identifier-syntax #t))) + exp ...)) + ;;; services.scm ends here. -- 2.41.0