From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id +JUDAGxf2mVKOQEA62LTzQ:P1 (envelope-from ) for ; Sat, 24 Feb 2024 22:28:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id +JUDAGxf2mVKOQEA62LTzQ (envelope-from ) for ; Sat, 24 Feb 2024 22:28:12 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=illucid.net (policy=reject) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708810091; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=GAtsu4Je9gS/L8K654y+ZnPee3JvPI3iO8olPSxVXJM=; b=oAIt5rqlUk1mTYNaplmhdsJTXLy12qszRhmipLcs75ZVVR3184CAwLXe90/jAeutPLSBC5 rIFcCJadgt5fMJFS66VBe44f4ixriIx9dLCwBdlEXTadoVIO+lL9SZs79ZoryrZ0K3kT0a xBsk3nvHgCWFVx/VliV/m6I9wgvRSVdBJ0hPTxwdUNUgD6uHAV2hVbINQeWcQB7BvLUw1R bvF8h+hbjrz/QDAvHWnfdqu6ShJSIYkSAcgiC589PRsOlCrveK6Jwth37IJpLyx20vXNLM gS10mQadveOhLsd42ORhBhjl5qFaZDhFbeirlKG8msWfAVLgGM51arz8eVLeWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=illucid.net (policy=reject) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708810091; a=rsa-sha256; cv=none; b=n1i5kU9pZAGsIyEiw7e/d/xEaYHqCEjIkF9t1dKNFJaDod4HXsLfYRnmbA2lrv+WZnTUkn 7Lvq9m/zU7gwjpahMtv36MSJs3RwPZam0fhshbftkUh8vxmKSzCTRrJrCTB7vT1u/Hax12 LfIpN3edth5i6B/En7NV4f58MqUjOWE5Sw6UHqJnpzAP78XdV9NDUR8h35SX6gOUbOvTwM dInVx0GCUFYREZkUsc82bVRwoXVAo4vIWVY/1/bhc1iECaDCU3gXZZszKB9A0NzLWdvoMa 2ENh06elSQuO+obU3YSkI4b28gcGVc4qCoTYJ9TFfCFEQgldbflQ7QFNonW9kw== 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 B10293EEAD for ; Sat, 24 Feb 2024 22:28:11 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdyw1-0006Am-Nc; Sat, 24 Feb 2024 15:47:49 -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 1rcC5b-0003dK-6J for guix-devel@gnu.org; Mon, 19 Feb 2024 17:26:19 -0500 Received: from wfout7-smtp.messagingengine.com ([64.147.123.150]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcC5Y-0006hv-Vo for guix-devel@gnu.org; Mon, 19 Feb 2024 17:26:18 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id 467F91C00084; Mon, 19 Feb 2024 17:26:14 -0500 (EST) Received: from imap44 ([10.202.2.94]) by compute5.internal (MEProxy); Mon, 19 Feb 2024 17:26:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illucid.net; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1708381573; x=1708467973; bh=GAtsu4Je9gS/L8K654y+ZnPee3JvPI3i O8olPSxVXJM=; b=Wj19mN+JjhMLYn7SN8wxsQ/jF5+D4KUKguggTwRuIQbGds2f 2C8OLulAcBzQ/TuhYyVS296i/ee18eqKneHVctRyAY8PMNVS9g3ziTpI870Ho7wU ntAu1I4FDcmkUlEOZiG80JVSg5jOuJzGhwm9rmI9AUXffv9v3H8BMZIoMXlu69KK AsTUHbJPUVRNA44dTck6665DRrBPtosoweHlvV+jtgxxk/c/ZVvDL8ExoAfhYQ0+ 8vj31qicnBklWNHZtd7BIUUqkIMiy/CMRaUHN8YE6Y4xAyBM1f2vbqKXiTrkdH3K w7UhwV+P8A1V8XzeG1HBwDheYFiNbjlK7BC58Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1708381573; x=1708467973; bh=GAtsu4Je9gS/L8K654y+ZnPee3JvPI3iO8o lPSxVXJM=; b=YG7vV5mpAOI2NfG0a8NwK35+RxN6NhYPEiUzx1FH8PKryB8DaR0 2FrYcVJ+nfElgaboPZzfg8Jnp25TXBAkQENbKzT1CRgWD6ftTj4DydSxIMZ3lXKX vCfnOQ214163cEaDlWyEqoxbaELejSKrMI0tSlGffc6MEa0D/JKX8niuoFLwQfdA w4JJRD4bvX8V53pPVkcn4zUJD7zRHI+MqTLa2J/ukBZAGoPJBzurP0CJgEPC7pWd G4H8qsR1FGUUFPVz8xxkcBbSSkt0KCSYf5dgH5gVk9Od8Qk0oBTuxNCTDSoCyZAb uJ4fNbwCIM3uB7d+LA89J8NzIhd7rCoiCAA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdekgdduheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvvefutgesthdtre dtreertdenucfhrhhomheprghnthhlvghrshcuoegrnhhtlhgvrhhssehilhhluhgtihgu rdhnvghtqeenucggtffrrghtthgvrhhnpeeutdefleejtdefhfeggeegvdefhfffgefhhe dugeevkeeggeeghfevgedtgfelgeenucffohhmrghinhepghhithhhuhgsrdgtohhmnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghnthhlvg hrshesihhllhhutghiugdrnhgvth X-ME-Proxy: Feedback-ID: i7f19465a:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 48C1536A0077; Mon, 19 Feb 2024 17:26:13 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-144-ge5821d614e-fm-20240125.002-ge5821d61 MIME-Version: 1.0 Message-Id: <1a7168a5-5207-4dfa-ac12-b3fed841580b@app.fastmail.com> Date: Mon, 19 Feb 2024 14:25:51 -0800 From: antlers To: edk@beaver-labs.com Cc: guix-devel@gnu.org Subject: Re: A friendlier API for operating-system declarations Content-Type: text/plain Received-SPF: pass client-ip=64.147.123.150; envelope-from=antlers@illucid.net; helo=wfout7-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, WEIRD_QUOTING=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 24 Feb 2024 15:47:48 -0500 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.36 X-Spam-Score: -2.36 X-Migadu-Queue-Id: B10293EEAD X-Migadu-Scanner: mx13.migadu.com X-TUID: rHy3/6k3d0+r Hi! Just wanted to say that I really admire your take on end-user service configuration in the Beaver Labs channel. I gravitated towards composing functions over `operating-systems` myself, though my config is probably only ""notable"" for the moderately-cursed `modify-record` macro that I use to derive/configure/wrap the services[1]: ``` (define (os-with-yubi parent users*) (modify-record parent (groups -> (cons (user-group (name "plugdev")) <>)) (users -> (map (lambda (user) (if (member (user-account-name user) users*) (modify-record user (supplementary-groups -> (cons "plugdev" <>))) user)) <>)) (services => (append <> (list (service pcscd-service-type) (simple-service 'u2f-udev-rules udev-service-type (list (specification->package "libu2f-host"))) (simple-service 'yubi-udev-rules udev-service-type (list (specification->package "yubikey-personalization")))))))) ``` It's like if `modify-services` was generalized over any kind of record, but instead of using pre-defined verbs like `remove`, the `body` component of each `(field-name -> body)` clause is wrapped in an implicit SRFI-26 `cut`-like[2] form to create an anonymous function that's applied to the field's value. It's a super leaky abstraction because I use a different symbol for `->` depending on whether that record-field is a plain value, a thunk, or a `delay`-ed form (and it could be implemented more efficiently), but it greatly reduces the length and indentation level of repeatedly nested, inherited record variations. ``` ((compose os-with-yubi [...]) [operative-system]) ``` I only wrote a handful of top-level `operating-system transformation` functions, and IIRC I only composed them at that top level; I think the way that you've broken them up into smaller forms and composed them out of each other though deeper, standard-functional composition gives you that same additive benefit over would-be nested forms, with each definition roughly matching up to one my "anonymous" invocations. What I still dwell on is whether there's a way to further minimize the code-volume of including additional functionality (as was pondered in a prior response, and as `modify-record` does in obsoleting `modify-services`'s verbs), and how best to avoid order-dependencies and expose inherit inter-service-configuration dependencies and conflicts. Tropin's RDE uses an emacs or systemd-esque `provides`/`requires` system which is satisfying, but introduces implicit standardization on the symbols associated with software roles and builds a significant graph of them, which I feel adds to the "bulk" of the (still very elegant) solution and embraces the need to wrap every service and transformation into their cohesive system-- that's part of what's kept me on plain Guix with my bandaid-solutions (in the spirit of learning the standard approach before exploring larger systems built on top of it). Anyway, I like your take, just fount it today and got to thinking-- thanks for putting it out there~ 1: From: https://github.com/AutumnalAntlers/old-guix-config/blob/main/modules/antlers/systems/transformations/yubi.scm 2: Like `cut`, but deeper: see the `<>` symbol nested deep within in the `users` clause of the Yubi example.