From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cKGzCIIYZ2RVtQAASxT56A (envelope-from ) for ; Fri, 19 May 2023 08:34:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id eHriB4IYZ2T9HgEAG6o9tA (envelope-from ) for ; Fri, 19 May 2023 08:34:42 +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 AEB4186A2 for ; Fri, 19 May 2023 08:34:41 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pztgs-0000tv-Or; Fri, 19 May 2023 02:34:16 -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 1pzqqO-0005OE-Kx for guix-devel@gnu.org; Thu, 18 May 2023 23:31:52 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pzqqM-0008Om-Bl for guix-devel@gnu.org; Thu, 18 May 2023 23:31:51 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-96b0235c10bso511317466b.3 for ; Thu, 18 May 2023 20:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684467107; x=1687059107; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=phO9zxSA4ANCFDIxVQ16TLtnC7kT1SWO8husOxDKXGM=; b=QINS16JUTzX3BK7O/UJ3q6DNgM7vd9EdyaUlOgsBcAYDwLbEuEyp5ENOH5ehdhUkPK +LZt8UV9uFAkm5GN8r4tumpdwvLSBEmRCHwxZScSFjVU3BsG3DSneHalEdGFOQrj4rHM kTHuCdPnb1lpJIR+WzCKk0TZLEFrkPg/p/46X6zHVE+3LSnAE46Dsw1VbPRHnkTyzyMq PxrxEsGOo7JL3k3DWN8fMDBPlfXRuwTK0orPGPU7EgT6jong/PUpvwQUKXVXMmuZoSLn EY6Z1FY9jY/exKmK1/G17RNe+OM9lVUxOwql44vPgL5pJpqDPXRJqCSHMBTzHFUh3ajO dn5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684467107; x=1687059107; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=phO9zxSA4ANCFDIxVQ16TLtnC7kT1SWO8husOxDKXGM=; b=S9iF60r4OxGMLtfH11qLc2avzSsxkkzaLlI7HoPqd4Stbpk6QxprkprDk78o5xCEK+ MC7Kx977P+iKJA9XVFqf59fwpn/36tDu0nUUJInlDqyC3mEYm7ht0FNvgP25zWmycO20 6iS4jAsET3MFyDikID+ESd3L/kzNbSsTUZQMXkhcod7NIQX1GPosbqH0xP2KxH7KER0d JvHFoKF7D/xHSMUze/DGxTg86eepbiwzzCL6bnmM6oLOS7L/Oj9m4RuFOa0+CYic+PFr tUUnTMLIFHf+dYP/lclRadyy3D+7n42SH+v2W1q4cRzYe7hZ+YaKIVVMb9lQo7IfDVR5 Sq/g== X-Gm-Message-State: AC+VfDy6ngNFNFNnT000uXPjDGXE9bIT+mbTdnFkNuK7WD0MmMpfONiX z9MaFW8TNSHNmWxnrvT2ivDWV3rq96fhVj/t9+bgIa6e X-Google-Smtp-Source: ACHHUZ42g/qLgmHS0kBmqdjj8Pxvr0CQGKRYl40UncN0vNl62wXd4EI3rb2JzQaUut/Oijy+AUkHCIK6o4FO1R0DYv0= X-Received: by 2002:a17:906:58c7:b0:96b:e93:3a9f with SMTP id e7-20020a17090658c700b0096b0e933a9fmr324271ejs.20.1684467107172; Thu, 18 May 2023 20:31:47 -0700 (PDT) MIME-Version: 1.0 From: antlers Date: Fri, 19 May 2023 03:31:35 +0000 Message-ID: Subject: Re: A friendlier API for operating-system declarations To: guix-devel@gnu.org, dev@jpoiret.xyz, edk@beaver-labs.com, liliana.prikler@gmail.com Content-Type: multipart/alternative; boundary="0000000000008f162705fc038fab" Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=autumnalantlers@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 19 May 2023 02:34:05 -0400 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684478081; a=rsa-sha256; cv=none; b=QhCmZjpV8E4VsNC7CgMec96a/tKY98ghofbmYoA0SqsJ+MxEpQK4yUD38QSKuLZx/m3ej5 MRMRQIW1NdiBj49CCuZqz0/9ALS3lL9m/t6Xrk+MFQYqL1WUnlmjvQsVHeMdIn/PQcuCtb L24xu6ebTgegEthFaLyDnXra4TSw7go+kqW6eZdx+Cx7/K8P9ZqyJslqIbeap+w6yjgPaD aV2LiViC223f+PnF2QZzd2WSuwRh0ktDmYgbIzJqhfB4f9Pso+UlCvpKhvKgwlGUl5/4Wb JdnbPeVSORr4SOiTYXlj4NG6s31PTwjglFp2N84iSVCB8fgQyEcCK2llPrzL+A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=QINS16JU; dmarc=pass (policy=none) header.from=gmail.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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684478081; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=phO9zxSA4ANCFDIxVQ16TLtnC7kT1SWO8husOxDKXGM=; b=nmA+St3FRY6aaom2f/LBbg91a11FrHLmrzc9oPTe3k14LwvShzntwJbTyjMJ2xLZ6EzzUh gQX+QoTNFN5ujrOQ7QiGaEcCOAIyrYnuk6Pmxpa9X14fmMEO6SWxLTRbpOu++J13vYKHRj LcJyL+1rikupiv+fLs0q+k3F4qT7uY9jVnHhHglmk823wNV/+aA748evpAX4Jy5+GYxRms i4jjSeUHPdm8psoL+NDd7H9Zn34F31KE0/n9rPIi+p3+8Rbrt888g7Wh/Iyj5EJiOG30CS F4UHxCqDxPhUob8e+w+ywlOjlcAKixtGJnTyWElVM0BBCAhBS++AHQUgbnq+6Q== X-Migadu-Spam-Score: -3.56 X-Spam-Score: -3.56 X-Migadu-Queue-Id: AEB4186A2 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=QINS16JU; dmarc=pass (policy=none) header.from=gmail.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" X-TUID: nfm+frgtb5gO --0000000000008f162705fc038fab Content-Type: text/plain; charset="UTF-8" Anecdotally, my personal configurations are built out of composable operating-system transformers that add packages, services, etc. through trees of inherited records. That's fairly straightforward for eg. adding packages, but becomes more complicated when you consider modifying service configurations (which you might want to inherit from when present and create when absent), nested service configurations (inheriting multiple times, the whole away down), or modifying kernel-arguments (where you might want to strip values for the option that you're setting from existing strings). I feel that operating-system record fields should be `extendable` in the same way as services, and have always assumed that that's basically what RDE's `features` are. It would be great to have structure that eliminates some of the nesting and boilerplate of an expression like this: ``` ;; imagine if this was (imperative-ness aside) as simple as: ;; lambda os: os.services(foo).z.foo += bar (lambda (os) (operating-system (inherit os) (sevices (modify-services (operating-system-services os) (y-service-type config => (y-configuration (inherit config) (z-configuration (z-configuration (inherit (y-configuration-z config) (foo (cons bar (z-configuration-foo (y-configuration-z config))))))))))))) ;; And if we want to create the service when it doesn't exist? (lambda (os) (operating-system (inherit os) (sevices (if (find (lambda (s) (eq (service-kind s) y)) (operating-system-services os)) (modify-services (operating-system-services os) (y-service-type config => (y-configuration (inherit config) (z-configuration (z-configuration (inherit (y-configuration-z config) (foo (cons bar (z-configuration-foo (y-configuration-z config)))))))))) (cons (service y-service-type (y-configuration (z-configuration (z-configuration (foo (list bar)))))) (operating-system-services os)))))) ``` --0000000000008f162705fc038fab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdiBkaXI9Imx0ciI+PGRpdiBkaXI9Imx0ciI+PGRpdj48ZGl2Pjxk aXY+QW5lY2RvdGFsbHksIG15IHBlcnNvbmFs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