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 aL8AAPW0F2IqeAEAgWs5BA (envelope-from ) for ; Thu, 24 Feb 2022 17:40:20 +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 qG0lOPS0F2I9cQAAauVa8A (envelope-from ) for ; Thu, 24 Feb 2022 17:40:20 +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 79CBF2ACBD for ; Thu, 24 Feb 2022 17:40:20 +0100 (CET) Received: from localhost ([::1]:40284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNHAB-0006Z1-KW for larch@yhetil.org; Thu, 24 Feb 2022 11:40:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNH9v-0006Xg-Sl for guix-patches@gnu.org; Thu, 24 Feb 2022 11:40:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNH9v-0000LQ-AO for guix-patches@gnu.org; Thu, 24 Feb 2022 11:40:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNH9v-0002rM-7w for guix-patches@gnu.org; Thu, 24 Feb 2022 11:40:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53676] [PATCH v2 4/4] 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: Thu, 24 Feb 2022 16:40:03 +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.164572076210918 (code B ref 53676); Thu, 24 Feb 2022 16:40:03 +0000 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 16:39:22 +0000 Received: from localhost ([127.0.0.1]:50256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH9F-0002q1-Oh for submit@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:22 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:34403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH9D-0002pV-Cy for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:19 -0500 Received: by mail-qv1-f50.google.com with SMTP id ba20so4610815qvb.1 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 08:39:19 -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=vhTTMDJdJkrTEyt5h66ZuKIKIyb4H3aU6NIk7ktcSBo=; b=EEGHfUJWaAmoUDuoDEhTvVp7peSfZ+z2dz2xra4ODF4W6Bhiq+xHBC3paVvkQ9gKmH mtKExMXAaKQTYcikKSLBjSL/ukFqC0Ae2vpqwtxmDw3YJxWKP/1C9ya+Ac2Vw7qe04c0 DMgXs8tSBZBA3fkMXAlUSQrPW27bcEM+2hcTCXernfJjLtYOeD+9IVyaWiDrNKdQ/nj3 OEP1wxqQX6vNkgs0gaIK9d5/cgvsWbovMhb+A4cqunLDMC6RoLNYOKetVcHUabmbo9RP Bbawmd7m2hK5gb/bmwOXhcV0B/iq9xwb0p3e48bbPmfaHZSsEwQofxNd4R2LB1j1evF0 GfYw== 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=vhTTMDJdJkrTEyt5h66ZuKIKIyb4H3aU6NIk7ktcSBo=; b=Ka+vq/i3/ueFavOZKNgSzPCcq+Xzl+dyvjvXcAqd7q1gIxMH7B5VFdahugO90PS+Sx MICBqcsfWLJDZkI2zJ334xgLN7kULRfKxT2O42MGBdiat/JmO/x774tvjjly2MrdCj8P DV/NAJtK446Jpkm5rIYnA8OHWdtI3wV+3qlv9KqZQwXQnJmBGImmw46LEhYshU5oAqf+ e5PMJIt+zJtajlGSg4byfJrjaBjw+f28AMs+Z79z+pNqiDKVbywL9lT3TlWPGn2AFn2G /YWmNGYLyi2HMSu6tUCJ3QgszfJoFXyJESD8QWNbLymixXTijOrd/vub2gsXQ/eWbQQU TGug== X-Gm-Message-State: AOAM530888YX0fTUBp81xlgwxxZrrQJuF25nMYIhZXqnHsuU5YTrbum6 ZPSfpuGSHLJ3sMwc9yQY9ODg+Nz5Y3Blag== X-Google-Smtp-Source: ABdhPJwQ8WSX7tu/ad6MIjWEcRW/JTuvq1wZ9Qv/59/7YIF1boYrzgconuWzCdcBBISg2c89zPIaTA== X-Received: by 2002:a05:6214:23cf:b0:42c:a789:146 with SMTP id hr15-20020a05621423cf00b0042ca7890146mr2812205qvb.89.1645720753654; Thu, 24 Feb 2022 08:39:13 -0800 (PST) Received: from localhost.localdomain (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id b13sm1900956qtb.71.2022.02.24.08.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:39:13 -0800 (PST) From: Maxim Cournoyer Date: Thu, 24 Feb 2022 11:38:28 -0500 Message-Id: <20220224163828.11330-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220224163828.11330-1-maxim.cournoyer@gmail.com> References: <20220224163828.11330-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=1645720820; 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=vhTTMDJdJkrTEyt5h66ZuKIKIyb4H3aU6NIk7ktcSBo=; b=GfPA+ZzI1JLbkpivS89UYerZRlRk12YjkZ/dQuISX4XknKB6KRLrJ2Hn2bksZmJBcxTDlR +lzmnpQodK1TAav3cxB1GNtBRoGFNzkrsgrU8iVMsewe/CG+kwLKuUEwWtvISH3NuovkBa vrO8tTnfkKM+t7DZw/p5J8fnkah/N93bGJJnHzWZs4iAmW3sUnRY8sQ5FqZFvXP8nIIrnY GIj8t+ksQLvsO6K6EUqLmyPjoZ45KEz/xNf9TMTj5Evkx4BiDFdQVDc6x58fPAgiSOV+sH GWlzyRoH5/1q6JfdVyIMm8cXclM96CfQ07qNckTKxsPRcPqCs4GDQkvquoJFzA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645720820; a=rsa-sha256; cv=none; b=ccX7RmKC65f7uchZ0DRJsEZE9OY6rHZ40PTolC1cEY2/7sXqQ5IvwY3dFTtrVnGM0+Oa+z 7pjtfn7QiwPXip+NvEKMuAza69aftJOttD2faflFKNKQNz4CPfXSNLAY8Ii6qGVLwD64u1 CDl+jOK420Mmpov4Kbm7Y2RzDhUMRWow0i7DTp3jOHQEz7q4/ntNPhJQI1ldgizmz5tsP6 YdIM3ITg+5o3TIts4aNUPnpLW9q1P2Tmh1CifXuLQUsTCGJsyuCIVzluzepMohLgP8I4W7 gklY4DdWB55Hy5fekkBJnmnbaFL+J07l9qIspXFy6FB6GBUIC3NPi7mvOdM40g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=EEGHfUJW; 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: -1.53 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=EEGHfUJW; 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: 79CBF2ACBD X-Spam-Score: -1.53 X-Migadu-Scanner: scn1.migadu.com X-TUID: +OlP3bedCJAN * 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 eecea1a733..336f6c39a0 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -144,11 +144,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." @@ -176,8 +176,8 @@ (define (assert-pulseaudio-script-file-name name) (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" @@ -186,7 +186,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