From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gNcqFN/5X2E6oQAAgWs5BA (envelope-from ) for ; Fri, 08 Oct 2021 09:57:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id AOItDt/5X2HlWAAAB5/wlQ (envelope-from ) for ; Fri, 08 Oct 2021 07:57:19 +0000 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 885C41469E for ; Fri, 8 Oct 2021 09:57:18 +0200 (CEST) Received: from localhost ([::1]:37016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYkkn-0000ZZ-2d for larch@yhetil.org; Fri, 08 Oct 2021 03:57:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYkkZ-0000Wp-CE for guix-patches@gnu.org; Fri, 08 Oct 2021 03:57:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYkkY-0007lb-6j for guix-patches@gnu.org; Fri, 08 Oct 2021 03:57:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mYkkY-0007c1-4W for guix-patches@gnu.org; Fri, 08 Oct 2021 03:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50967] file-like objects instead of gexps Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Oct 2021 07:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50967 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Andrew Tropin Cc: Oleg Pykhalov , Xinglu Chen , 50967@debbugs.gnu.org Received: via spool by 50967-submit@debbugs.gnu.org id=B50967.163367978429192 (code B ref 50967); Fri, 08 Oct 2021 07:57:02 +0000 Received: (at 50967) by debbugs.gnu.org; 8 Oct 2021 07:56:24 +0000 Received: from localhost ([127.0.0.1]:49010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYkjv-0007am-W9 for submit@debbugs.gnu.org; Fri, 08 Oct 2021 03:56:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYkjr-0007aU-H2 for 50967@debbugs.gnu.org; Fri, 08 Oct 2021 03:56:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60390) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYkjl-0006vz-OQ; Fri, 08 Oct 2021 03:56:13 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60584 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYkjl-0004BD-5a; Fri, 08 Oct 2021 03:56:13 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211002163834.29583-1-go.wigust@gmail.com> <20211002163834.29583-13-go.wigust@gmail.com> <87pmsnnukj.fsf@yoctocell.xyz> <878rz8q42z.fsf_-_@gnu.org> <87czoilgbg.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 =?UTF-8?Q?Vend=C3=A9miaire?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 08 Oct 2021 09:56:11 +0200 In-Reply-To: <87czoilgbg.fsf@trop.in> (Andrew Tropin's message of "Wed, 06 Oct 2021 11:15:31 +0300") Message-ID: <87a6jk54ro.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633679838; 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; bh=k8ObmYCf/IMMWbcpYBKLz8htjrDOO1Li6layyCpaFWw=; b=OJCg4+gaeLkXBS4+BzXRr/7FVVYcUQox/rUHCx3f8wg7BsQHs9IPKBYR17Nvy51erjxtxb wMLvKl8Nc9M1I6PpV7a8qeyKCXW/7yaBesFc9GJKi121eXmIhZKKsQqhZm6dOU4g22yItb 0wTB2bXJu65j1HnteMYES4w34gMMab8tMF+E55wliVP011ll31rSCfj+zWoz5IXxUXbRND aW/YFr+dC/VKyS4CjoBY+6SAUq6YTaeErD3LE7WTols+PnVfEgrNXeE3iBdsKvQ9k6jgO8 LfW5ARhK1ygEgLOtZoYzPWpDojTVDowpvlBPSQwTEhV2uz+N39z92YicnftMxQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633679838; a=rsa-sha256; cv=none; b=j5wCeB4eYbAt6T64aXj72GHQsHeX1v9zJsukGizjhrPyXz9WgtpDwA209EZeBhaxS9jgSc tPojuFC1KjhqBG3hl1O8D4AV88qB/uxzQcxUhIEet6GCtRK+TYhgiIRFU945o+hb7+cfgp uhiDc7T9JzGg6dGjXBxTQzKkDtyGeGh+e1DIEKQRmrG5/9Zd1Td7mtuwC0aVHCVUbdZUX9 TuhwH3Df9BN4d6OxFOHVdPxZ/UXNUYlazIhGFluj7575+jnKHaPhpwlQOqjegiru7EwhOp LsRHJC/7ynfYu2iVZRauZ9geiKYGV6JApWdmrRheNYDUpnnFA2syfjDMz3wUuA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 885C41469E X-Spam-Score: 0.09 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5AFw/0z+A1JN Hi Andrew, Andrew Tropin skribis: > On 2021-10-04 16:04, Ludovic Court=C3=A8s wrote: > >> Xinglu Chen skribis: >> >>> On Sat, Oct 02 2021, Oleg Pykhalov wrote: >>> >>>> * gnu/home/services/configuration.scm (interpose): Include content of = files. >>>> (string-or-gexp?): Rename to 'file-or-string-or-gexp?' and check for f= ile-like >>>> object. >>> >>> I would call it =E2=80=98file-like-or-string-or-gexp?=E2=80=99, just = =E2=80=98files=E2=80=99 doesn=E2=80=99t >>> really make it clear that it should be a =E2=80=9Cfile-like object=E2= =80=9D. >> >> As a matter of API, I would make it monomorphic: accept a file-like >> object, period. This is what=E2=80=99s done for System services (and >> polymorphic APIs are rare in general in Guix). > > At least some of system services are far from ideal, recently I tried to > add rtmp section to nginx configuration using nginx system service. I agree that nginx config is problematic: https://issues.guix.gnu.org/37388 But IMO that=E2=80=99s off-topic. :-) > Imagine the following use case: I want to create a home service, which > accepts a package (zsh plugin) and adds a code for loading this package > to zshrc, currently it's implemented like that: > > https://git.sr.ht/~abcdw/rde/tree/69dd2baf0384c899a4a4f97bdac8bf0b6e499b8= 2/item/gnu/home-services/shellutils.scm#L18 > > Exteding the service above with `(list zsh-autosuggestions)` will add > the following line to zshrc: > > source /gnu/store/w7d43gk1qszplj9i0rkzqvzz6kp88qfm-zsh-autosuggestions-0.= 7.0/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh OK. Then that=E2=80=99s fine: you can have special code that emits those =E2=80= =9Csource=E2=80=9D lines in .zshrc while still allowing users to provide their own file-like object for .zshrc lines they want to add. Again, see how =E2=80=98torrc=E2=80=99 is generated in =E2=80=98tor-service-type=E2=80=99. I=E2=80=99m happy to discuss specific service examples in mode details if y= ou want. Overall, I=E2=80=99m confident Home services don=E2=80=99t require a= ny pattern that=E2=80=99s not already found in one of the many System services. :-) HTH, Ludo=E2=80=99.