From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id OFa1IItmfWaHaAEA62LTzQ:P1 (envelope-from ) for ; Thu, 27 Jun 2024 13:18:03 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id OFa1IItmfWaHaAEA62LTzQ (envelope-from ) for ; Thu, 27 Jun 2024 15:18:03 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=IZfRJgXo; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719494283; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=oCKi5ECtM7cs2tuATCFh9PC0gx27KAsU6zphcgC3wW8=; b=bFOMK+Aep2kH2B+OWtG0djd8r206X+Ih00EMiRXWItG1rWGgUjJxOfVhNCuYagnespQIl5 vgjR+l+Q799MH9YSQqYWcGZ3QzqFRBHuv00vyiilWxHhl5M57TBbTBdqbwll2cucXuBP4O xt7PL+vraeYf7VwoaxoJZxAtHjr2S6sTKsMJUsbprBYRoohuZNhCEa/n4ALU7cOvj7sxp5 gnsfLMOjoHIdvszl7+g7Gxk8JrfbeDhWdCv+9W3YEL2h0fSLLz0JFAaPfba/CO6eHSTrNC iJAFAV+uy5GQG5XXmKi5O8HA6SF29WHzbgmGEqto0xdYgB9/4l/e3F+fcLE9yg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719494283; a=rsa-sha256; cv=none; b=FcHWkMRJliLzLUErx6e7CvOYfZD4ri6F9Roq1nTUXVjjNekOzAMbZc1BM3I80zamdVX6/y vELMgRR47E0k4Bwh4VUecrVO6+IvND/NZwPA87tmSCCUj1WrIs3xX4Flj8HP23EyLJfREv 0I0uG0pZ1u8DUuzZPMTPbNLVimGouOvVXY/ZycffH07coLdm4IIXdStvgXNIsREMDoJZDZ A2Q3uaH0WCl93ri2pTHjY4SkoxwcQFZJqOSUzfJXBIWiMtucBg5Jn9/2MujnZA3SfNWEDu TTPN5qjxh3wp4QxIxHogvj7e5FrakUMI0Ez2h+tnrY4/Yz6eDt14TMzfFge/4w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=IZfRJgXo; dmarc=pass (policy=none) header.from=gnu.org; 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" 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 6CEE06BAD8 for ; Thu, 27 Jun 2024 15:18:03 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMp0L-0007NU-J7; Thu, 27 Jun 2024 09:17:37 -0400 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 1sMp0H-0007KV-Ch for guix-devel@gnu.org; Thu, 27 Jun 2024 09:17:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMp0B-0008B0-0S; Thu, 27 Jun 2024 09:17:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=oCKi5ECtM7cs2tuATCFh9PC0gx27KAsU6zphcgC3wW8=; b=IZfRJgXoh7ZYbIqwigR/ cldGbXMyJDLiQEiX2nrCa4LgyRL9BzoRmu8+uFN6PRpwH54Gyz8t1Z1aSrz7ze5B2MJ3gPeSzvzzb oarusMPLGmD5hQE2nPWcRoYFyZxbBShLsjN01CEV9WnxpK4JWP/EnKtA1L898NJdBp8nsxtqtVoDf w1RN0yHTuO+fU7BLbo3LCEJ/CUPEnkVNwJtRx80PcI5FcPNDE/GCrKhHYxcgYc2IJ/YV6oW2yAOzz NfT4WTq+o18YYE+PUzBvCCv5hKmZSll28eQs1D1vgE1mBH0PlRh53i8P6Q7Q++nux+8jp0wfnPF3/ dT87LGAZNOhI2A==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Sergio Pastor =?utf-8?Q?P=C3=A9rez?= Cc: guix-devel@gnu.org, michal_atlas+gnu@posteo.net, "juli@incana.org" Subject: Re: New procedure to modify operating-system records In-Reply-To: ("Sergio Pastor =?utf-8?Q?P=C3=A9rez=22's?= message of "Sun, 23 Jun 2024 18:13:48 +0200") References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 10 Messidor an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de la Faucille 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: Thu, 27 Jun 2024 15:17:24 +0200 Message-ID: <87y16q5xuj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Queue-Id: 6CEE06BAD8 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.62 X-Spam-Score: -9.62 X-TUID: /qAUWMp2IsPj Hi Sergio, Sergio Pastor P=C3=A9rez skribis: > I'm writing this mail from a system that grafts `mesa` for the > `nvidia-driver` available in [1]. Although I'm aware that this is not > the place to discuss proprietary stuff, this is not about running an > NVIDIA system. This enables any Guix user to arbitrarily replace > packages system-wide. One could replace `glibc` for `glibc-custom`. I'm > using the NVIDIA graft as an example because it's what I have at hand > that would test that the graft applies system-wide effectively. > > The procedure allows the user to apply a function to all elements of a > collection that match a certain type. With this new procedure one could > write something like this: > > (map-type > (lambda (_) > (@ (gnu packages games) cowsay)) > (@ (guix packages) ) > my-operating-system) That sounds useful! > The complete implementation can be found in my personal channel [2]. [...] > [2] https://codeberg.org/shepherd/omega/src/commit/0d45b10f709cfbc70c3ec7= 56933f09a296a9d6e3/pastor/utils/gpu-specification.scm#L51 My main concern with this approach is that it breaks abstractions. Ideally, records would only be accessed through their public accessors (which might perform additional processing, such as unpacking =E2=80=98thun= ked=E2=80=99 fields) and created by their public contructors (which might do things like run field =E2=80=9Csanitizers=E2=80=9D). We always (almost) keep reco= rd type descriptors (the things) private also for this reason. So while I think the feature is much welcome, I believe we should strive for an implementation that doesn=E2=80=99t break abstractions. As I mentioned earlier, one option would be to apply transformations at the derivation-level: take the OS derivation and use =E2=80=98map-derivatio= n=E2=80=99 to map, say, the derivation of one package to another one. The advantage is that we=E2=80=99re guaranteed to not miss a single package; the downside= is that it=E2=80=99s low-level and might not perform well. Food for thought! Ludo=E2=80=99.