From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gD/XLD+1+GGe1AAAgWs5BA (envelope-from ) for ; Tue, 01 Feb 2022 05:21:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gExVKT+1+GHg8AAAauVa8A (envelope-from ) for ; Tue, 01 Feb 2022 05:21:19 +0100 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 3C59D15497 for ; Tue, 1 Feb 2022 05:21:19 +0100 (CET) Received: from localhost ([::1]:37090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEkfN-0003wy-Sn for larch@yhetil.org; Mon, 31 Jan 2022 23:21:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEkf8-0003vy-J3 for guix-patches@gnu.org; Mon, 31 Jan 2022 23:21:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEkf8-0006Qd-5H for guix-patches@gnu.org; Mon, 31 Jan 2022 23:21:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nEkf8-0003T9-1x for guix-patches@gnu.org; Mon, 31 Jan 2022 23:21:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53676] [PATCH 5/5] services: pulseaudio: Deploy the configuration files to /etc/pulse. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 01 Feb 2022 04:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53676 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53676@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 53676-submit@debbugs.gnu.org id=B53676.164368921013237 (code B ref 53676); Tue, 01 Feb 2022 04:21:02 +0000 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 04:20:10 +0000 Received: from localhost ([127.0.0.1]:41450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkeH-0003RI-KM for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:20:10 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:41912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkeD-0003Pz-FQ for 53676@debbugs.gnu.org; Mon, 31 Jan 2022 23:20:06 -0500 Received: by mail-qt1-f172.google.com with SMTP id y8so13425511qtn.8 for <53676@debbugs.gnu.org>; Mon, 31 Jan 2022 20:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ug4kgRT5rrjNr38XTxLR+siYJ8RJZYvplq7ERpjY9yg=; b=XJgZtJpND91echpeUN9/u+PcZJsiyZmCQTp1n6guRiO5r0nAgjo5yxi4V/nqTMSq14 5sTpPKFHueSiVv2/gc7rXngZ91HEmaICot74tVsG0mgPJmjS0ePajPD2jJzTnW3sY+I7 bDBnsxg+HxminlqnmT//ugoHNHFCyso5ALaDJGUL/k7ajwrXvC11UIqdd73JRnI/jqOD V+cAdktr8Rxmlpc06AwAXOuOcV709pS9/fbTtytCQMAIY5lPJcnqoG5/yH6iXUKoj1Bj YJt9CfiJtMisR7JKehFHfBUAkaA5gM7U2azH8bHt4CU9XNrBYZJlejqPGe5IQljSRcIE V+RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ug4kgRT5rrjNr38XTxLR+siYJ8RJZYvplq7ERpjY9yg=; b=7irxC7mZPVfgYlFzu98ILK4zLl84O7zudhUs6NdC+wHx1aI16o0UFPRYTVMWOSzeYJ yowN4QzHKEQwy+VC9b9wkXq5d9ZtLrtLjofiKeK32sncgqA22GjyGZGFGR/gR/qCOboj e4IAlqKWFwLq7A6cmaqUu6PNzWDJdGLtWCpTVcao+CBlogGjTqvM0kwMoJem7YZy5sGV PGyO8u3w9qq+AjpzDInSyDHeiPQvbqGhDUnKjEW/JnRAqxsWsjQYnp7MKI5Af9zuApJJ t2QcN6qu+/4oV0rcA3VhY4twWwq3G0yH6wAomihhxZMFxYxHZNUoHNaqBFMVjE59Tzn4 pK3w== X-Gm-Message-State: AOAM533qyPp8ToQ6MJnxSTA8s2l1k23NJDqP+U5nTwAftqco+bP3+ItC i/FlDwz7X2cklAiD+GUmZW8EHchkwZ0= X-Google-Smtp-Source: ABdhPJxjLzkf6nzOGMDPcPONY44cXizAWcgv+wcag8GJsQF1ZHscuLW5Pv1kfWA7gztN7K37w4ZYJQ== X-Received: by 2002:ac8:5cd2:: with SMTP id s18mr17347068qta.558.1643689199880; Mon, 31 Jan 2022 20:19:59 -0800 (PST) Received: from localhost.localdomain (dsl-10-141-111.b2b2c.ca. [72.10.141.111]) by smtp.gmail.com with ESMTPSA id a8sm9192439qti.71.2022.01.31.20.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 20:19:59 -0800 (PST) From: Maxim Cournoyer Date: Mon, 31 Jan 2022 23:19:33 -0500 Message-Id: <20220201041933.16603-5-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220201041933.16603-1-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643689279; 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=ug4kgRT5rrjNr38XTxLR+siYJ8RJZYvplq7ERpjY9yg=; b=CdnSoEaSKv3ox4cLibNnHdnlpI14qWYIR19+JnFR+qXoxSrPySPkF48RUteMj4ek8i0RfC caxxrwreI3IvWGaGwMjt9wOpHitQ59CelYVbiwugkjGvbRXKjQOGd+KK7iSAHDCeJYQ3mj PDvxGEqokfGgesso4PxrnW+ySnLvLZT/OIVWrkdxI1X2/Kgy1BJAWGImydwKJKg1p5V5iE X7MrgDhvT4iqnzwMAVZVJgK43JzPyi5cxUdFte2y3+eE7IGXniHHvuRfbxuLvipDjdA4tY jzWdAptdWOkmYuqtRuzJ0+yhjprhDMgZ4DD2tRRc9GHOF+FaJW5NHj4P3tw+jw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643689279; a=rsa-sha256; cv=none; b=dDzj1Lynj23y4CGWvdRdNrdfSvZ/DQem/DBUpY587pPzK7Vt12cmvFF15myre+pEJ5b3t+ QpSQykMimqeZG/2sMklabgSBHhCx37kq/fmzp8TBdOqGRNkGn5iW7TZaUSp01pjZwpjIBl xG1OR364NqPM0aIUSq0wuzK+n5RAfVlnFc40Be5mGs5iINCIUDsnSW8GlCqd7+XVHcnEck gQx6R5MxS+TrXQ6iXDpkiJ4w82dHfTWTxxXTY5HxnlwwniUMypvJmgUHVfmJG5WMgTWlCz iIliLMyeNg97MXI7flC2R5kfsqdktrXVYEqfi8dJ+2yCa9FUFlvf5NVAyvbdZw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XJgZtJpN; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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" X-Migadu-Spam-Score: -2.83 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XJgZtJpN; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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" X-Migadu-Queue-Id: 3C59D15497 X-Spam-Score: -2.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: nJWtFRY6QSoI * gnu/services/sound.scm (pulseaudio-environment) [PULSE_CONFIG, PULSE_CLIENTCONFIG]: Use fix locations, and move logic to... (pulseaudio-etc): ... this service extension. Guard against producing empty files. --- gnu/services/sound.scm | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index f529188a7c..0877788f06 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -142,11 +142,11 @@ (define (pulseaudio-conf-entry arg) (define pulseaudio-environment (match-lambda (($ client-conf daemon-conf default-script-file) - `(("PULSE_CONFIG" . ,(apply mixed-text-file "daemon.conf" - "default-script-file = " default-script-file "\n" - (map pulseaudio-conf-entry daemon-conf))) - ("PULSE_CLIENTCONFIG" . ,(apply mixed-text-file "client.conf" - (map pulseaudio-conf-entry client-conf))))))) + ;; These config files kept at a fixed location, so that the following + ;; environment values are stable and do not require the user to reboot to + ;; effect their PulseAudio configuration changes. + '(("PULSE_CONFIG" . "/etc/pulse/daemon.conf") + ("PULSE_CLIENTCONFIG" . "/etc/pulse/client.conf"))))) (define (extra-script-files->file-union extra-script-files) "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNION. @@ -157,8 +157,8 @@ (define (extra-script-files->file-union extra-script-files) (define pulseaudio-etc (match-lambda - (($ _ _ default-script-file extra-script-files - system-script-file) + (($ client-conf daemon-conf default-script-file + extra-script-files system-script-file) `(("pulse" ,(file-union "pulse" @@ -167,7 +167,18 @@ (define pulseaudio-etc ,@(if (null? extra-script-files) '() `(("default.pa.d" ,(extra-script-files->file-union - extra-script-files))))))))))) + extra-script-files)))) + ,@(if (null? daemon-conf) + '() + `(("daemon.conf" + ,(apply mixed-text-file "daemon.conf" + "default-script-file = " default-script-file "\n" + (map pulseaudio-conf-entry daemon-conf))))) + ,@(if (null? client-conf) + '() + `(("client.conf" + ,(apply mixed-text-file "client.conf" + (map pulseaudio-conf-entry client-conf)))))))))))) (define pulseaudio-service-type (service-type -- 2.34.0