From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SCC9AiTJl2Lr2wAAbAwnHQ (envelope-from ) for ; Wed, 01 Jun 2022 22:16:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id eNbNASTJl2L2GgEAG6o9tA (envelope-from ) for ; Wed, 01 Jun 2022 22:16:36 +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 8B74E168C for ; Wed, 1 Jun 2022 22:16:35 +0200 (CEST) Received: from localhost ([::1]:44724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwUle-0006d7-LS for larch@yhetil.org; Wed, 01 Jun 2022 16:16:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwUl8-0006aR-GE for guix-patches@gnu.org; Wed, 01 Jun 2022 16:16:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwUl8-0007r5-75 for guix-patches@gnu.org; Wed, 01 Jun 2022 16:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nwUl8-0007DO-33 for guix-patches@gnu.org; Wed, 01 Jun 2022 16:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55653] [PATCH] guix: Add syntactic sugar for profile generation. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Jun 2022 20:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55653 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Andrew Tropin , 55653@debbugs.gnu.org, Maxime Devos , zimoun Received: via spool by 55653-submit@debbugs.gnu.org id=B55653.165411451527674 (code B ref 55653); Wed, 01 Jun 2022 20:16:02 +0000 Received: (at 55653) by debbugs.gnu.org; 1 Jun 2022 20:15:15 +0000 Received: from localhost ([127.0.0.1]:51968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwUkN-0007CH-Dd for submit@debbugs.gnu.org; Wed, 01 Jun 2022 16:15:15 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:46061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwUkM-0007Bw-3X for 55653@debbugs.gnu.org; Wed, 01 Jun 2022 16:15:14 -0400 Received: by mail-ed1-f65.google.com with SMTP id er5so3649569edb.12 for <55653@debbugs.gnu.org>; Wed, 01 Jun 2022 13:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=an4iLilFua7LgsF2maBonrm6s0lc1qOrcUYYRJGhEy0=; b=Ksl/3m1V1WjmELDiWEV16G/VhsJUhs/EHClJa6UaYAlYWTzgQm+Zwak6egr2vjoKlr BHcvSca2FNyKIVTwv2RrVh4DFqQ89gJd3+nHSbFrcJ3KltarpZij66Mf/QbmApzh7nsM o2DnldqQy8Njd30PrdYyoVrua5Co95OauZ+Iu8s7LsSjKesVnhWGr/rOz6Kehms/YK83 xyHDu+WsVuxJh/+KZ7f0cOj7Fc85F8UhpoRiesSAAtgjC25LBcof5KebvmVv2jODUnnY qafVcSwq9iv7tOVsjfEtFdxDXci/ZtYmQsKUB3jWWtwqcMYBvkLrlJRf1kdGe1SqlJlp E6Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=an4iLilFua7LgsF2maBonrm6s0lc1qOrcUYYRJGhEy0=; b=7ml7sMM/rr3NoWPBuXyRMTm4ad8WjJfZ5B4DnPAPoyFMDjc668woCLhxL4XUzJ0CBz wZ5YA2P2reLfRoecuHFSnSDgYu+jHnVyOVToAKAEGFmbvHvDFIDHs1CMdx7uj9/zKGb8 pd+NUFfWJoNYYcoafNCefNTIq04tyyxrt9Bs1/z8cBYOJCMrmUYa4pUapxipqouFRujD 1aeNkA9NtbWk3ZRrco58S7QtpJbtj3adkSvzFjZk1zifgCq+oD28uruSqbRtU0rfCij+ GwKjUsdW45qp44f0dmt0tntd67IT9erggfPAETrQ6/VKAHOrARcbQTK6NTTInBZ5j8pJ KslQ== X-Gm-Message-State: AOAM531lFlXqT43jzdr9KvdKWFumWHljuF0iWHXMYo3B8rNO/W1PsBZh SDJ6rnLUbe+56DOaZUG2W1U= X-Google-Smtp-Source: ABdhPJwU4wUqA6JUeHicekeUWGZ1N8bGFID31ZtjkefMLIkSagf7Okkc3EdCdX8lMsf9sLgoGrECtA== X-Received: by 2002:a05:6402:1cc1:b0:413:2b12:fc49 with SMTP id ds1-20020a0564021cc100b004132b12fc49mr1638980edb.118.1654114508078; Wed, 01 Jun 2022 13:15:08 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id r18-20020aa7cfd2000000b0042dc8dd59c7sm1478316edy.51.2022.06.01.13.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:15:07 -0700 (PDT) Message-ID: <60b305664d635fa72c2162d0e55fe44af3c95461.camel@gmail.com> From: Liliana Marie Prikler Date: Wed, 01 Jun 2022 22:15:06 +0200 In-Reply-To: <87zgiwtbid.fsf@gnu.org> References: <10354f31e0be9bcb88b78da2fb8a2a3c3acbde10.camel@gmail.com> <87sfopyfte.fsf@gnu.org> <87zgiwtbid.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 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-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654114595; 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:dkim-signature; bh=an4iLilFua7LgsF2maBonrm6s0lc1qOrcUYYRJGhEy0=; b=YHDFBCyYIL55CnNPCh7XbG8PbL1iTIYNjmMp8VTN9WUBHsrHSmzBLzmwMm39ViXJWgFnSe Kp9t/dzicFMstyOzgzGdwudH4XHFyj4TD9gQocRZ2L2/wLssxPj6A48r/bAOWcAF0O5DWj npLyQn8NcJaCM6xvRv+fxARtfdpMkHeCgZzwr5/MdGIxJiYIvG3PfNckn2CsUA4iJ4MxOX INg8NBQi2QZtzsn8pM8hISeX3V+NVFDGgV6r8eatZUmy/8Ixi5RvHG18X9SAmJwxegemdc 0GvsUqN0zBwdQcNcbBOioL71AZYnPLfH40MccdDByN4DzKaNoEW4IHIZoXa/Yw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654114595; a=rsa-sha256; cv=none; b=nqguLcPmqsEmBWxFrbtuyrQCH4EeHpsNt44sOjJQreOhEuWau/RNpLk5ygdGSNNXZnEjGg xqb4EGZp5QC4wShoa6kNLXjPF6/0JdPB48PW1FbmXom2RpwOkAdnuwBQEc3ooDsHqhdY3h FLYIH4D7abr6nnHTW4Cww7UdvyUoj/QO9QR+nzk35pw2xJxxSMdCeDCK7IyKh206bUJeaZ Jsp71/hacI5+xs5eyG8PS9A1TcENGkP1TeZQuL15BKoPUKOVeDX2WBf0XHPcseV+rPZoQf R3HDyvGpZ9bE6tieS2SeLcevTN4r8rIh3EDbxMwffIX5K3V87qeYshhXIw9agg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="Ksl/3m1V"; 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: 7.47 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="Ksl/3m1V"; 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: 8B74E168C X-Spam-Score: 7.47 X-Migadu-Scanner: scn1.migadu.com X-TUID: lrVDlfibErOq Hi, Am Mittwoch, dem 01.06.2022 um 21:43 +0200 schrieb Ludovic Courtès: > [...] > > > > > > We don’t have syntactic sugar like this elsewhere, and I would > > > prefer to remain consistent here.   > > We do have origin sha256, which sets both hash-algo and hash- > > content, so it's not unprecedented in my opinion. > > ‘sha256’ is a backward-compatibility hack for ‘content-hash’, so it’s > a bit different in my view. > > To be clear, what I meant is that record construction always look > like this: > >   (constructor >     (field1 value1) >     (field2 value2)) > > whereas here the proposal (IIUC) is: > >   (constructor >     (field1 several values that get bundled together magically)) If it reads like that, then that's probably a mistake somewhere. My actual proposal to allow both of the following: (package other-fields ... (manifest some-manifest)) (package other-fields ... (packages (list bash coreutils emacs ...))) > > > However, if that helps, we could have a procedure, like: > > > > > >   (define (packages->profile name packages) > > >     (profile (name name) …)) > > > > > > Thoughts? > > I do think syntactic constructors feel better here, because the end > > goal would be embedding things in (thunked) configuration fields. > > Having a procedure might be acceptable, but feels more clunky in > > the context of Guix. > > To me, ‘packages->profile’ doesn’t look any more clunky than > ‘packages->manifest’ or similar procedures. > > Do you think a procedure like this would address the verbosity > problem that prompted you to propose this patch? I don't think it does tbh. We currently have two implementations of packages->profile-entry, one for Guix System, one for Guix Home, which at the time of writing are exactly the same. My use case of naming profiles would be served by such a procedure, but using a syntactic constructor has other benefits in that all of the fields of the profile become accessible. That means that users could (once profile management via Guix Home is implemented) for instance run less hooks or additional hooks for certain profiles, allow collisions, use relative symlinks, etc. for basically free, not to mention that changes which break record ABI (such as added fields) get promoted directly through syntax but not through a plain procedure. Cheers