From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 YLoZEv04HGT3IAAASxT56A (envelope-from ) for ; Thu, 23 Mar 2023 12:33:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uM6yEf04HGRbMAEAauVa8A (envelope-from ) for ; Thu, 23 Mar 2023 12:33:17 +0100 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 ADCDF374F4 for ; Thu, 23 Mar 2023 12:33:16 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfJBg-0005Hn-KA; Thu, 23 Mar 2023 07:32:56 -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 1pfH2T-0001wy-ED for guix-devel@gnu.org; Thu, 23 Mar 2023 05:15:17 -0400 Received: from sender11-op-o12.zoho.eu ([31.186.226.226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfH2Q-0002wY-KK for guix-devel@gnu.org; Thu, 23 Mar 2023 05:15:16 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1679562902; cv=none; d=zohomail.eu; s=zohoarc; b=OrEcSj9VhrImxIrnnuX2UUVIdtYbW55hHCDfOcUnKWWZBNMoKG/kV8D1OtomLrWLH/YvOKOWOFtiDPA6rs9YFtaSMn9k9Sku97YbRE55D3XdmOTAKK+qGi5+THSYrNLVDhymlZgfjxGcKH4xpRB7Uy1UxdtTU4LJhniu/+Yssr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1679562902; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=XjP49N/uT/y6GrR+iU8BlBgl3sOv0DNiVHUIa56avZ8=; b=jcLXoO5NZuaQzuR9nUCsZ46ofL6AWB7dp82NRoxIJc5e2gYf7OdFT0L43m+eYw8t7UKpV5OWwKNP+SJ8qGctVu6Le62NN6kd18EvX7MGLv1KAAWDkSns4KJRciv/4/9q00+VhkoqXTTADezQvsImZAd2/a/cL+/MmM++vrv/mnY= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=beaver-labs.com; spf=pass smtp.mailfrom=edk@beaver-labs.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1679562902; s=zoho; d=beaver-labs.com; i=edk@beaver-labs.com; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To:Cc; bh=XjP49N/uT/y6GrR+iU8BlBgl3sOv0DNiVHUIa56avZ8=; b=DMfEbeX0uIWFdgzK0RGd9jrWDFvFa7ifTQE/ZTnaVXEsY6sIb3Yr5Ns8PgR95w+b 4OyLr+7uSz5ohVJZ+KQUN6xYjhcMp7/B7ee7/6aVVhZTDCyHItghuMkpKgA6nv3leDq MNYKfME8B83m5hPrjpzpSfWuQgQRB2tL1lZLXOLRPxmnbpuZjknEyJ32VN89o7FW2/h OflgB4FZOVNOjWKjKbgsVAI54buOgfxrs4Jrx1vJ7LmqHsQNHudbIB0oaLgtD2//3IW 9bDkC+wni0tHSCjDBLG/Z/QvNjm+vAZB/lq2Ij2cGlZnSWRRDJYL51PxFddbTayO5H2 JqCPQbGnIQ== Received: from schwarzy (lfbn-idf3-1-667-244.w86-252.abo.wanadoo.fr [86.252.237.244]) by mx.zoho.eu with SMTPS id 1679562899617891.6759439427515; Thu, 23 Mar 2023 10:14:59 +0100 (CET) User-agent: mu4e 1.8.13; emacs 28.2 From: Edouard Klein To: guix-devel@gnu.org Subject: A friendlier API for operating-system declarations Date: Thu, 23 Mar 2023 09:06:52 +0100 Message-ID: <87wn377rst.fsf@rdklein.fr> MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External Received-SPF: pass client-ip=31.186.226.226; envelope-from=edk@beaver-labs.com; helo=sender11-op-o12.zoho.eu 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 23 Mar 2023 07:32:53 -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=2; s=key1; d=yhetil.org; t=1679571197; a=rsa-sha256; cv=pass; b=r64y9081q0g8D1B5cT3hWKoLLD+ACrDhDlKcZeeZNWZxoZ/xKn/dVogTxd7BEpVlfRf3OA cWwwAtdcsG577keS2NS0aNJSQdQ3R4QrFc0VEN5DRC+mq+tsT6sYZbHDiRq+04Kv/RfsXj n5reNNsH2my414J++2JzrMKm6qX1TP8LuT/ABJWptKM1PA6rqEtk7QA4KIhHq+aWvriGje bY0lSGTWT/c9Z1nww0epk7yo7+CB9M/SMpeZCcPMTnJWnnBFWrE94KOuhW3OjKUC1lVd1a +LNIbmFoD2q7258GwwZRwhhURNBf9r7m3zvUgh3C73Hv6rjMw6cPv7yhixA4vA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=beaver-labs.com header.s=zoho header.b=DMfEbeX0; dmarc=none; 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=pass ("zohomail.eu:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679571197; 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=XjP49N/uT/y6GrR+iU8BlBgl3sOv0DNiVHUIa56avZ8=; b=qnXb4NvgoYmmt2N6iBQN8M/gKlBHgIJ+Ni2kcsA5cWVe2Iq5gns+626AEyLWGkbnn1Aytz x/LfedxoOvIL7hT6FIiVkAz9nDDhCEQNGYOF+SHEZimyciHGr1LbU6Gxn3EO1/QTZKWofX ejpJI76zqtmPqd/Gw7yFpCAkPFSzEFrFSzyA3CM9W9IPQ5X41loKyJroEguSOfWhHI4gFh LubAJmO9R5E7defkL5Q5na9RvuqZCO6rDNg0N7GDK/GwnCOV6db3krbEYRWPe+DuTTWLPz jLAMYPc06w3UaJEmS98h2+anwR9O97T8pHPs8J9zeEI+YLpg9QmC55siubiu2A== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=beaver-labs.com header.s=zoho header.b=DMfEbeX0; dmarc=none; 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=pass ("zohomail.eu:s=zohoarc:i=1") X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -3.24 X-Spam-Score: -3.24 X-Migadu-Queue-Id: ADCDF374F4 X-TUID: J2mTk8ElGt3M Dear Guixers, For my clients and my own use, I use a layer on top of operating-system declarations in which I create functions that take an os as a first argument, and return an os. With the help of the handy -> macro, I can chain them, thus allowing an easy stacking of multiple "roles" or "functionalities" on the same machine, and an easy transfer of said functionality to another machine: just cut and paste one line from one declaration to the other. I have written a tutorial for my clients here: https://guix-hosting.com/docs/tuto/getting-started.html that gives an example of what an os configuration may look like: #+begin_src scheme (-> (minimal-ovh "ssh-rsa AAASomethingSomething== root@minimal-ovh") (http-static-content "sub2.example.com" #:to-dir "/srv/sub2") (http-static-content "sub1.example.com" #:to-dir "/srv/sub1/") (add-services my-db)) #+end_src The code of the function is on my channel: https://gitlab.com/edouardklein/guix/-/blob/beaverlabs/beaver/system.scm After a few months of experience, and positive feedback from my clients, my question to you guys is: would you be interested in mainlining this, or should I keep my development efforts separate in my channel ? I do think this API is easier than manipulating services, and although extendable services are awesome and a very nifty piece of engineering, they require quite a good knowledge of scheme and take a while to be used to, while this new API, while way less powerful, lowers the barrier to entry for newcomers. They are an easy way to maintain a declarative whole operating system configuration, with a syntax similar enough to docker and ansible that sysadmins familiar with it can quickly get up and running, thus exposing more people to Guix. What do you think ? Cheers, Edouard.