From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yJvZDWdsRmPq8QAAbAwnHQ (envelope-from ) for ; Wed, 12 Oct 2022 09:27:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id yAXyDWdsRmMN7gAA9RJhRA (envelope-from ) for ; Wed, 12 Oct 2022 09:27:35 +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 D04D219ECC for ; Wed, 12 Oct 2022 09:27:34 +0200 (CEST) Received: from localhost ([::1]:54838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiW9N-0000Eq-Ss for larch@yhetil.org; Wed, 12 Oct 2022 03:27:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiW7w-0000D8-59 for guix-patches@gnu.org; Wed, 12 Oct 2022 03:26:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56442) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oiW7u-0002Xe-Pk for guix-patches@gnu.org; Wed, 12 Oct 2022 03:26:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oiW7u-0006S2-Gn for guix-patches@gnu.org; Wed, 12 Oct 2022 03:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58454] [PATCH 1/1] gnu: home: Add home-dbus-service-type. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 12 Oct 2022 07:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58454 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58454@debbugs.gnu.org Cc: "\(" X-Debbugs-Original-To: "( via Guix-patches via" , 58454@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166555955524785 (code B ref -1); Wed, 12 Oct 2022 07:26:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Oct 2022 07:25:55 +0000 Received: from localhost ([127.0.0.1]:55520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiW7m-0006Rg-Rn for submit@debbugs.gnu.org; Wed, 12 Oct 2022 03:25:55 -0400 Received: from lists.gnu.org ([209.51.188.17]:37740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiW7k-0006RY-0k for submit@debbugs.gnu.org; Wed, 12 Oct 2022 03:25:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiW7j-00005z-Ol for guix-patches@gnu.org; Wed, 12 Oct 2022 03:25:51 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:53453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiW7g-0002Uv-NA for guix-patches@gnu.org; Wed, 12 Oct 2022 03:25:51 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id B5FAEE0012; Wed, 12 Oct 2022 07:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1665559543; h=from:from: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; bh=GC74ZrHRI+l1M50AwtZ70EHzWM62HofFRzhasBv3IVY=; b=PjWCav4k7OvsgXiUKS+/kCc07KG/EvSThPNhXgsn5xdMQdUVyoWj19B/kEOh1m9aHENr7T clsT/TiO42sK5SlWkkycVKVTmur+RuueU7sTf63VwYtHcTeBRwC6+xaVv5vl/IZvQ8CQvc OMK9xg0oDtHkvuPiUFFW9PAr7RfGerTd6AH5fgO8u5LF2aec60mpYHMDgnb+oi8rS1kjnS gnv+lKGZLw5sRdll23zUwv6l2SmmYVN/IPZI55t00KOudfC85/WWzWaI33IMgAr3yASLek HVH3Z/9cfdsoCLC31ehKd9AcYUxzCdeCsUHT1BoiA/AEJJhztTNtvBO9gmknOA== From: Andrew Tropin In-Reply-To: <20221011195430.26160-1-paren@disroot.org> References: <20221011194513.26008-1-paren@disroot.org> <20221011195430.26160-1-paren@disroot.org> Date: Wed, 12 Oct 2022 11:25:31 +0400 Message-ID: <87ilkpmrkk.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:4b98:dc4:8::224; envelope-from=andrew@trop.in; helo=relay4-d.mail.gandi.net X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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=1665559654; 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: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=GC74ZrHRI+l1M50AwtZ70EHzWM62HofFRzhasBv3IVY=; b=ENC65G3PlDbCju3pzuCQIMlnuy+byiZVo1efLxykfAPE+EmRqrkFRnChINqDfIwl9VE3Q1 3Rc9l9yQER2DjljVAg0vA4sBz6NIt1KavhwboAZzW1IlCP8ofmZycq/xH3URQqxVm+uq1+ EFKDQqcA05doK3l+O59x37isQZ6lKz25PxQep8R0VvPcm+2Hd4wrhXC2sP5/PlvjWajqSn t79G3/ku5Uma3O2/58CRTpKEZp64mBtMyFx6Dj1lDI4UNdjHZy3VTJx9brlcoiXKpqXulx ymI+m3hGQiTLk5MBpLLh2mDjqovPwWWpLw5S9DPS+nUYB+IsgiXWkdB3t10sxA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665559654; a=rsa-sha256; cv=none; b=gTlyzfko1wSSfuTZHtDQYTbAlzc2pPReJ14YfOG23fMeG1GX0PB41UfaZIBiGfnLXIQ/9a CHO78/R0fPaSLHuN9M6hQ5vAcMWgzrhSR61ig6JVwy43uiT7LR8qbO02pShdWMfQNlYa5P Q3dIEz4dtE9cNjFDhhHNb1emsAGEpu0EKt0NdsSLA+Ghqwc6yqDjp71tDJMijFOtp4UPVR rUkOin+iWxzgRma9E8cFmaVjIgJ4NyFBerG9epKdzMDYFJX1WDiz+D8G3xw9HJjmfqbg84 Eax+0bAG12OzJXztG8/92AP7NdZbBc0UEo/92dlU8OYHZ+caz9NOI2v1F5d5KQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=PjWCav4k; dmarc=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.60 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=PjWCav4k; dmarc=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: D04D219ECC X-Spam-Score: -1.60 X-Migadu-Scanner: scn0.migadu.com X-TUID: 7siNM+jwoFcy --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi unmatched-paren! Thank you for the patch, it looks good and I think can be merged in the way it is right now, but I wrote a few minor notes/nitpicks below. On 2022-10-11 20:54, "\( via Guix-patches" via wrote: > * gnu/home/services/desktop.scm (home-dbus-service-type): New > variable. > (home-dbus-configuration): New record type. > * doc/guix.texi: Document them. > --- > doc/guix.texi | 17 ++++++++++++ > gnu/home/services/desktop.scm | 52 ++++++++++++++++++++++++++++++++++- > 2 files changed, 68 insertions(+), 1 deletion(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 5867acb746..990113703b 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -41262,6 +41262,23 @@ format. >=20=20 > @end deftp >=20=20 > +@defvr {Scheme Variable} home-dbus-service-type > +This is the service type for running a session-specific D-Bus, for > +unprivileged applications that require D-Bus to be running. > +@end defvr > + > +@deftp {Data Type} home-dbus-configuration > +The configuration record for @code{home-dbus-service-type}. > + > +@table @asis > +@item @code{dbus} (default: @code{dbus}) > +The package providing the @code{/bin/dbus-daemon} command. > + > +@item @code{verbose?} (default: @code{#f}) > +Whether to enable logging. > +@end table > +@end deftp > + > @node Guix Home Services > @subsection Guix Home Services >=20=20 > diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm > index b0f4d969b0..4cf151762d 100644 > --- a/gnu/home/services/desktop.scm > +++ b/gnu/home/services/desktop.scm > @@ -1,5 +1,6 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2022 ( > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -20,6 +21,7 @@ (define-module (gnu home services desktop) > #:use-module (gnu home services) > #:use-module (gnu home services shepherd) > #:use-module (gnu services configuration) > + #:autoload (gnu packages glib) (dbus) > #:autoload (gnu packages xdisorg) (redshift) > #:use-module (guix records) > #:use-module (guix gexp) > @@ -27,8 +29,10 @@ (define-module (gnu home services desktop) > #:use-module (ice-9 match) > #:export (home-redshift-configuration > home-redshift-configuration? > + home-redshift-service-type >=20=20 > - home-redshift-service-type)) > + home-dbus-configuration > + home-dbus-service-type)) >=20=20 > > ;;; > @@ -172,3 +176,49 @@ (define home-redshift-service-type > (description > "Run Redshift, a program that adjusts the color temperature of displ= ay > according to time of day."))) > + > + > +;;; > +;;; D-Bus. > +;;; > + > +(define-record-type* > + home-dbus-configuration make-home-dbus-configuration > + home-dbus-configuration? > + (dbus home-dbus-dbus ;file-like > + (default dbus)) > + (verbose? home-dbus-verbose? ;boolean Sounds a little missleading as it doesn't control the verbosity of logging, but the logging as a whole. Also, does logging to file work at all when --syslog-only option provided? > + (default #f))) > + > +(define (home-dbus-shepherd-services config) > + (list (shepherd-service > + (documentation "Run the D-Bus daemon in session-specific mode.") > + (provision '(dbus-session)) > + (start #~(make-forkexec-constructor > + (list #$(file-append (home-dbus-dbus config) > + "/bin/dbus-daemon") > + "--nofork" "--session" "--syslog-only" > + (format #f "--address=3Dunix:path=3D~a/bus" > + (or (getenv "XDG_RUNTIME_DIR") > + (format #f "/run/user/~a" > + (getuid))))) > + #$@(if (home-dbus-verbose? config) > + (list #:environment-variables > + #~(list "DBUS_VERBOSE=3D1") > + #:log-file > + (format #f "~a/dbus-daemon.log" > + (or (getenv "XDG_LOG_HOME") > + (format #f "~a/.local/var/lo= g" > + (getenv "HOME"))))) > + '()))) > + (stop #~(make-kill-destructor))))) > + > +(define home-dbus-service-type > + (service-type > + (name 'home-dbus) > + (extensions > + (list (service-extension home-shepherd-service-type > + home-dbus-shepherd-services))) Do we want to extend environment-variables with =2D-8<---------------cut here---------------start------------->8--- '(("DBUS_SESSION_BUS_ADDRESS" . "unix:path=3D$XDG_RUNTIME_DIR/bus")) =2D-8<---------------cut here---------------end--------------->8--- ? > + (default-value (home-dbus-configuration)) > + (description > + "Run the session-specific D-Bus inter-process message bus."))) =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmNGa+sACgkQIgjSCVjB 3rBtDg/+LUO4ET7FJlJuOxf4ExfusiFX2ftczEeoEXxH9N5UeRDBWy3gv9m2+rBl nNdlpAJi0CsZm53AxnfXLiSc1RANa2WRxO1k2kgDKdGfa9vz7hnWmhoqtXxjsUZ6 r2/zjd2Anl7+xzYPzSSfwUlUzkZJ8IKrfASKdeIwS/kAYpwGFTUh58n2Ub4DfBcp meqOCKhsvGq+5woKmIwtWzYpO+08giydOlhh34IxN81coNP/BuiinWprcqMxUexa ENzvyVLt9f+J31cTomHe2YpBTsLaknzOrsf9S0lryEsvEyfmxssbD+IbAmB4oXpH yn3teOzHsH5GoKcFz0dBDHLTLpStTMJHOwJ+A3Qh6xUl1pijt94rFmOs5D7jk+g0 GgOUYJ6PmEg7IzL+t/yP8ubgY+hZV3/oYknv3Oh4fF+gtQdJD9FrfhgQYmpXL1pd FWOI/QSye4UVYyHFzSC1LpO9r+vKVZw1yJCXzXgTHNGz4Hu6AhTFtbetDz7le22A yLdpN75/OWPbuwiQBjKgZajBOJjvNTpVDCOUM/UFOeGZGr0cTzzPauPyh16jR6He wIBCsE94cOcdtV1SEAAX1G41TihyNMWHEgnIBwhD+VxbUsAmgJIXpa12mLbl7WXZ Vpec0y9NzCyQtIsdst+uc8WjRt/X/HmjUJyMiC+Je+cvzFU4d0U= =Tuex -----END PGP SIGNATURE----- --=-=-=--