From patchwork Fri Mar 22 17:21:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 1526 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2EF3616D69; Fri, 22 Mar 2019 17:22:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 6CE1E16D69 for ; Fri, 22 Mar 2019 17:22:07 +0000 (GMT) Received: from localhost ([127.0.0.1]:60628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7Nrq-0007g4-MO for patchwork@mira.cbaines.net; Fri, 22 Mar 2019 13:22:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7Nrn-0007fu-Uu for guix-patches@gnu.org; Fri, 22 Mar 2019 13:22:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7Nrm-0002n0-QL for guix-patches@gnu.org; Fri, 22 Mar 2019 13:22:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41085) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h7Nrm-0002lD-Hm for guix-patches@gnu.org; Fri, 22 Mar 2019 13:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h7Nrm-0001PJ-9q for guix-patches@gnu.org; Fri, 22 Mar 2019 13:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#34948] [PATCH 0/3] Turn 'essential-services' into an field Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 22 Mar 2019 17:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34948 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34948@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15532753005379 (code B ref -1); Fri, 22 Mar 2019 17:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Mar 2019 17:21:40 +0000 Received: from localhost ([127.0.0.1]:54629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h7NrQ-0001Oh-9A for submit@debbugs.gnu.org; Fri, 22 Mar 2019 13:21:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41319) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h7NrL-0001OR-K7 for submit@debbugs.gnu.org; Fri, 22 Mar 2019 13:21:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:44750) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h7NrG-0000m1-Ex for submit@debbugs.gnu.org; Fri, 22 Mar 2019 13:21:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7NrF-0007cC-AT for guix-patches@gnu.org; Fri, 22 Mar 2019 13:21:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7NrD-0000dl-Mj; Fri, 22 Mar 2019 13:21:27 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=49236 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h7NrD-0001C7-Ac; Fri, 22 Mar 2019 13:21:27 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 22 Mar 2019 18:21:20 +0100 Message-Id: <20190322172120.10974-1-ludo@gnu.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello Guix! This is the solution that Arun and I were discussing: https://issues.guix.info/issue/28128#17 This series adds support for “self-referential records”: from the definition of a thunked field, you can use ‘this-record’ to access the record that the field belongs to. It then uses that to turn ‘essential-services’ into a thunked field of rather than an inaccessible internal procedure. This allows us to remove all the #:container? flags from (gnu system) and instead of (gnu system linux-container) simply override ‘essential-services’ as needed. Thoughts? Thanks, Ludo’. Ludovic Courtès (3): records: Allow thunked fields to refer to 'this-record'. accounts: Add default value for the 'home-directory' field of . system: Add 'essential-services' field to . doc/guix.texi | 8 ++- gnu/system.scm | 71 +++++++++----------- gnu/system/accounts.scm | 7 +- gnu/system/examples/bare-bones.tmpl | 3 +- gnu/system/examples/beaglebone-black.tmpl | 3 +- gnu/system/examples/desktop.tmpl | 3 +- gnu/system/examples/docker-image.tmpl | 3 +- gnu/system/examples/lightweight-desktop.tmpl | 3 +- gnu/system/install.scm | 3 +- gnu/system/linux-container.scm | 69 ++++++++++++------- gnu/system/vm.scm | 13 ++-- gnu/tests.scm | 5 +- gnu/tests/install.scm | 14 ++-- guix/records.scm | 24 ++++++- tests/accounts.scm | 4 -- tests/records.scm | 40 +++++++++++ 16 files changed, 169 insertions(+), 104 deletions(-)