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 8Aq2A1JYa2PGEQEAbAwnHQ (envelope-from ) for ; Wed, 09 Nov 2022 08:35:46 +0100 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 YB2iA1JYa2NDmQAA9RJhRA (envelope-from ) for ; Wed, 09 Nov 2022 08:35:46 +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 8A10990EE for ; Wed, 9 Nov 2022 08:35:45 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osfcE-0004UA-9S; Wed, 09 Nov 2022 02:35:18 -0500 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 1osfbz-0004RA-UB for guix-patches@gnu.org; Wed, 09 Nov 2022 02:35:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1osfby-0007uc-TZ for guix-patches@gnu.org; Wed, 09 Nov 2022 02:35:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1osfby-00023N-PI for guix-patches@gnu.org; Wed, 09 Nov 2022 02:35:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#58818] [PATCH 1/1] gnu: home: greetd-service-type: Add gexp compilers for sessions. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Nov 2022 07:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58818 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58818@debbugs.gnu.org Cc: "\(" X-Debbugs-Original-To: "( via Guix-patches via" , 58818@debbugs.gnu.org Received: via spool by 58818-submit@debbugs.gnu.org id=B58818.16679792457800 (code B ref 58818); Wed, 09 Nov 2022 07:35:02 +0000 Received: (at 58818) by debbugs.gnu.org; 9 Nov 2022 07:34:05 +0000 Received: from localhost ([127.0.0.1]:38869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1osfb2-00021k-VU for submit@debbugs.gnu.org; Wed, 09 Nov 2022 02:34:05 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:34009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1osfb0-000216-KB for 58818@debbugs.gnu.org; Wed, 09 Nov 2022 02:34:03 -0500 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 2E4BB1C0003; Wed, 9 Nov 2022 07:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1667979236; 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=zxDH75PVHYPe28eB0XzljPm2xjptfkyVmighfDUNRE0=; b=eVhot2ctXwndRyApKlTDxnbbezHf38Fb1PYgBoNVZ966bTbG4i1LFYbudm/6YC63SxtDa4 uLy+P5Att5IzzmTdRsJx0JICbqkHOeTnLQz0Ao5olUPzcpts3LMNmuj5qOeSJl8qSQipXF rzBHVMmI6I6q6aYCI/IsdyrIcE16Hpw7ITBx14NFm/VFqBbbTWeoZ/TTYtUYiphsX/G4h2 2vKTFiLa6KX3ZDBQ/OVplC+6TdEHW+5odd0PCmzTGUQFyt3TUoqs7uVWGRIKAEwtx5G7cr eU1YVyH+9nTUoPDzmFbTDaqfsRk78RR9JIEP7ocnfXskPrTJlbkVhJrka8Z/hQ== From: Andrew Tropin In-Reply-To: <20221027173809.25625-1-paren@disroot.org> References: <20221027173526.25556-1-paren@disroot.org> <20221027173809.25625-1-paren@disroot.org> Date: Wed, 09 Nov 2022 11:33:50 +0400 Message-ID: <87v8nolgyp.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667979345; 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=zxDH75PVHYPe28eB0XzljPm2xjptfkyVmighfDUNRE0=; b=lnvkoyKqEw4U2+r035QRc83xloP5sR7TKW1e6THBMp/UpUneAV5/XI8yhlPTa4oizYXE8K /m+/UmI1j7u43WNDQgdm9RfyLVcyCFUYMQZ/GscJz3xWwukcFzUgjJYNFEx5QD37AQ0b1j W36VI4ld/ABqcD4BXA+HVCGgRIOUNGokSHL3SHvyNG7CGZyK+RAVcW5KbWpDbHZJ1+n0qv tCNjVTljK8FQq+GP7M8XfiCLRg/PNxm22GtHRfdg/iHH/Vg4fzSoAfqn0AGRgTwCzaQvHg /cUVWRJWgVVjfAT3s4jQPDqQOH5vjJBEfs8Cc7eLnixEHwwgLwkAoa+nKQOcSA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667979345; a=rsa-sha256; cv=none; b=eAP6upjqeOH2HQVMial4PkJoIziFB6XK4cgQ6iymkcIFnDIv7jOn8dEhqu1pNnh+weSoWP yBnReRkiI4cC+SY5/KKk+6aRRnYO/GQeU2J+cOtTin8Q6dum7y2PO6VNxbmZmM9VLq+k5m 4gBHWWLy0OS5w/QIhbeLX+JdOtuqO0dyv5M16pTA1QdMHWRKIYt8XXeKbhjO8csaX0AhB+ epfYBJctC0Tb0SxxmhzAQNxX6NuC8T9li5sucJ2qiX8JOif9hxnk5swziffD9QHYa0Prg9 ADY7dGHRfXpLZ8KLE9vDoZqojaVD66yCJ49/OfTiM/A9fYm2uSWO8A0/+Xn78Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=eVhot2ct; 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: -0.72 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=eVhot2ct; 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: 8A10990EE X-Spam-Score: -0.72 X-Migadu-Scanner: scn1.migadu.com X-TUID: EihU0vQ+LcGz --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2022-10-27 18:38, guix-patches@gnu.org wrote: > * gnu/home/services/base.scm (make-greetd-agreety-session-command, > greetd-wlgreet-sway-session-command, > make-greetd-default-session-command): Remove variables. > (greetd-agreety-session-compiler, > greetd-wlgreet-sway-session-compiler): New gexp compilers. > (greetd-terminal-configuration)[default-session-command]: > Remove it. > --- > gnu/services/base.scm | 65 ++++++++++++++++++++----------------------- > 1 file changed, 30 insertions(+), 35 deletions(-) > > diff --git a/gnu/services/base.scm b/gnu/services/base.scm > index d3e3335030..3bf924b8f1 100644 > --- a/gnu/services/base.scm > +++ b/gnu/services/base.scm > @@ -2900,11 +2900,18 @@ (define greetd-agreety-tty-xdg-session-command > (quote (#$@extra-env))) > (apply execl #$command #$command (list #$@args))))))) >=20=20 > -(define (make-greetd-agreety-session-command config command) > - (let ((agreety (file-append (greetd-agreety config) "/bin/agreety"))) > - (program-file > - "agreety-command" > - #~(execl #$agreety #$agreety "-c" #$command)))) > +(define-gexp-compiler (greetd-agreety-session-compiler > + (session ) > + system target) > + (let ((agreety (file-append (greetd-agreety session) > + "/bin/agreety")) > + (command ((if (greetd-agreety-xdg-env? session) > + greetd-agreety-tty-xdg-session-command > + greetd-agreety-tty-session-command) > + session))) > + (lower-object > + (program-file "agreety-command" > + #~(execl #$agreety #$agreety "-c" #$command))))) >=20=20 > (define-record-type* > greetd-wlgreet-session make-greetd-wlgreet-session > @@ -2991,37 +2998,26 @@ (define (make-wlgreet-sway-configuration-file ses= sion) > "exec \"" wlgreet " --config " wlgreet-config "; " > swaymsg " exit\"\n"))) >=20=20 > -(define (greetd-wlgreet-sway-session-command session) > +(define-gexp-compiler (greetd-wlgreet-sway-session-compiler > + (session ) > + system target) > (let ((sway (file-append (greetd-wlgreet-sway-session-sway session) > "/bin/sway")) > (config (make-wlgreet-sway-configuration-file session))) > - (program-file "wlgreet-sway-session-command" > - #~(let* ((log-file (open-output-file > - (string-append "/tmp/sway-greeter." > - (number->string (getpid)) > - ".log"))) > - (username (getenv "USER")) > - (useruid (number->string (passwd:uid (getpwuid username))))) > - ;; redirect stdout/err to log-file > - (dup2 (fileno log-file) 1) > - (dup2 1 2) > - (sleep 1) ;give seatd/logind some time to start up > - (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid)) > - (execl #$sway #$sway "-d" "-c" #$config))))) > - > -(define (make-greetd-default-session-command config-or-command) > - (cond ((greetd-agreety-session? config-or-command) > - (cond ((greetd-agreety-xdg-env? config-or-command) > - (make-greetd-agreety-session-command > - config-or-command > - (greetd-agreety-tty-xdg-session-command config-or-comma= nd))) > - (#t > - (make-greetd-agreety-session-command > - config-or-command > - (greetd-agreety-tty-session-command config-or-command))= ))) > - ((greetd-wlgreet-sway-session? config-or-command) > - (greetd-wlgreet-sway-session-command config-or-command)) > - (#t config-or-command))) > + (lower-object > + (program-file "wlgreet-sway-session-command" > + #~(let* ((log-file (open-output-file > + (string-append "/tmp/sway-greeter." > + (number->string (getpid)) > + ".log"))) > + (username (getenv "USER")) > + (useruid (number->string (passwd:uid (getpwuid username)= )))) > + ;; redirect stdout/err to log-file > + (dup2 (fileno log-file) 1) > + (dup2 1 2) > + (sleep 1) ;give seatd/logind some time to start up > + (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid= )) > + (execl #$sway #$sway "-d" "-c" #$config)))))) >=20=20 > (define-record-type* > greetd-terminal-configuration make-greetd-terminal-configuration > @@ -3035,8 +3031,7 @@ (define-record-type* > (terminal-switch greetd-terminal-switch (default #f)) > (default-session-user greetd-default-session-user (default "greeter")) > (default-session-command greetd-default-session-command > - (default (greetd-agreety-session)) > - (sanitize make-greetd-default-session-command))) > + (default (greetd-agreety-session)))) >=20=20 > (define (default-config-file-name config) > (string-join (list "config-" (greetd-terminal-vt config) ".toml") "")) Applied, tested agreety session, adjusted commit message, pushed as fdc9e1b27edfb3df51d391364bcbc50e9cd1de40. Thank you! =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmNrV94ACgkQIgjSCVjB 3rB37A//fFH0LUbzRVkkOYOzSk52HcGXOA9rp5CAUNR31BNK3G6q5OogPLwzjWUB LzgiUeBJzXhLUzEmS/ZpldZtm4Q/6zckmltvfrAe62sosoZporQ80xUkJ72OTa9p xcaIfbYzH7eKIw5uv9Wp00pLAI9aMrJuYMcVAXX563CdZqOkRdqHKgmJ1q4VErxE ux/CtxHxpmxpTJUDLeK7wFO4zrNpZS4TFe1drMgJtnTQRt+hzmB++OCIVACNPxLw BPSm/BoUG0u5m77RfRZrdLr5AoKiZC3r5Db7EcFk/GqgmmRxAOrduUptX5YmOYzC OR/xYfB+fq62dlAII8vewx37Y4VvgasesjEbiLvhUhAiLyAM6c3WO8A8zsq962c6 NidWnPdFxnq/ATTGtReNrhqyBqsDQG+6k1Ox2ZnQJJy/MSVkFIduuIXaYfp5vS40 0VOLMmv4Iex0jQvFiIlD4WFTPG9I5gCsuXYRZzgAJuAdbX2Ly1nqTNKCGumZlQYT oLWTJp15XhH3c84lMcIBAgP0rYURe9BLS+oK19Dwt6eas7bY8uZWpgPef1GitEM8 cZyyhAzDranVkvPqsB59ZWIKJ/i/QKM/I3H46/iXMJDSqJiSJmKxelAq2BJFs6u3 dzPyYkkRH+m7llSUUbPNgDx71bYuIO+6zyTlkralH+dL+u/5vM8= =kyQu -----END PGP SIGNATURE----- --=-=-=--