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 ms0.migadu.com with LMTPS id OO1eEts7AGI1pgAAgWs5BA (envelope-from ) for ; Sun, 06 Feb 2022 22:21:31 +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 cOIWD9s7AGIeAgAAauVa8A (envelope-from ) for ; Sun, 06 Feb 2022 22:21:31 +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 00CE83856E for ; Sun, 6 Feb 2022 22:21:31 +0100 (CET) Received: from localhost ([::1]:52632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGoyQ-0007mA-6C for larch@yhetil.org; Sun, 06 Feb 2022 16:21:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGoxy-0007l4-Dy for guix-patches@gnu.org; Sun, 06 Feb 2022 16:21:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46065) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGoxy-0003LE-4F for guix-patches@gnu.org; Sun, 06 Feb 2022 16:21:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGoxx-0005jU-V2 for guix-patches@gnu.org; Sun, 06 Feb 2022 16:21:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53826] [PATCH 2/2] doc: Clarify the Swap Space examples, and include an helper example. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Feb 2022 21:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53826 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53826@debbugs.gnu.org Cc: Josselin Poiret Received: via spool by 53826-submit@debbugs.gnu.org id=B53826.164418245422001 (code B ref 53826); Sun, 06 Feb 2022 21:21:01 +0000 Received: (at 53826) by debbugs.gnu.org; 6 Feb 2022 21:20:54 +0000 Received: from localhost ([127.0.0.1]:39962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGoxq-0005in-4K for submit@debbugs.gnu.org; Sun, 06 Feb 2022 16:20:54 -0500 Received: from jpoiret.xyz ([206.189.101.64]:50604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGoxn-0005if-Q9 for 53826@debbugs.gnu.org; Sun, 06 Feb 2022 16:20:53 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 11A871851EE; Sun, 6 Feb 2022 21:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1644182451; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OjLwQpJxisc+vy1rv9f+xgxrq9q6LL4i0E+89vQUVD8=; b=uBY2sgrEqzsJEpJjWiPskrh63fhdFZaBl6Pw5Ky9llYcHEKVfBoBeeGJQspPWbo/gwfPCH BF62UDIXXPbneEX47BEzFZnp8bZAVVmWZOL+Srm0qFz+MVaglJPSriHZrSB3XoIceqM/fj RTTBaEb9dR1htZ+b0nHKUoletmb81AEdVfd9h7e5DN062O3IbHi/ll5ERCLTURz/G94XMz xvd2J1sV0eqWKb98+ULuDwCKkAYTv7vQWI5/S7Jt6knpdnmLLpw9OE3rmMMYXf47ljJKtH t2ozOQlk1vf6x7LQkdatwdvLOmPRSlLw4lXBMYUmg5/XlGnLuFmrQXNciLSVRQ== Date: Sun, 6 Feb 2022 22:20:45 +0100 Message-Id: <20220206212045.19257-2-dev@jpoiret.xyz> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644182491; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=OjLwQpJxisc+vy1rv9f+xgxrq9q6LL4i0E+89vQUVD8=; b=B9/GMXFV5m1b6JjNxgNYSLW7+oNSMc48dT38/NxKcG7m/3XOrQKYY8oFRpd+N2iRPV6j39 57F1Ucq4zibcD9es+vWV7m/0MMQIhScbAkCgmbD3QNTS+YFO34xjINKzprYnZ0F6qnLAlO 09INqfDuZHCnXiWLqMqvvjfLhHqNzcGqvqz3ku6i5CFaDIW+RFF74XE3i4i/l1z8KexxbP 36ppxClK0j76rs2OqWoQeq8djY5DC97nTgKyoCFjLZorV3eKM0CVUCrkapvNmGNVJ9H2XS VtTPMh3MAkA7y90nui3Dg4jcPnnVicgEJqKKIF/sWZq5ORonWjuFRWgKo8pcaQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644182491; a=rsa-sha256; cv=none; b=Hxox7HKVyvvMwcSA1wqchjIfSl6mF9HuqVIbBuCNgUSjq/rwztctjnBC/T02GnlAmWfNKG ymsezOcnOEZ1UqL47rhqrD9H5iv1BFJ+lmsP0bVRUOc/PXKy3gPjrzf5GCNek0JaY1uKtc EMPcD/1Fz6SryTGZCYZ7r9snSB+sEQBw8Nn8MaATpSzHwU1CNvlULvz39rTgSGhmALKhR3 kns3WY0sMLn96bnlfbc8DWsUQWJgFR4PBjMfOdUcmfQAB0k+y8CqHSfoKA+TkL9pNp6h2e EnWlQ9aOXvSryaBfCAD2Oycvwc4s2TUZxae8DWoQIP7TG6AT8wteS5NMENKyRA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=uBY2sgrE; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.13 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=uBY2sgrE; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 00CE83856E X-Spam-Score: -3.13 X-Migadu-Scanner: scn1.migadu.com X-TUID: zOf0ViDp4Cbd * doc/guix.texi (Swap Space): The examples referred to variables defined outside of the snippets, and so were not very informative for people without much Guile knowledge. Instead, refer to mapped-devices for the first, and use the new helper file-systme-mount-point-predicate for the second. --- doc/guix.texi | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0cf865a672..49bc8d55e6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -15737,22 +15737,39 @@ Linux swap partition by running @command{swaplabel @var{device}}, where @lisp (swap-space (target (file-system-label "swap")) - (dependencies (list lvm-device))) + (dependencies mapped-devices)) @end lisp -Use the partition with label @code{swap}, which can be found after the -@var{lvm-device} mapped device has been opened. Again, the +Use the partition with label @code{swap}, which can be found after all +the @var{mapped-devices} mapped devices have been opened. Again, the @command{swaplabel} command allows you to view and change the label of a Linux swap partition. +Here's a more involved example with the corresponding @code{file-systems} part +of an @code{operating-system} declaration. + @lisp -(swap-space - (target "/btrfs/swapfile") - (dependencies (list btrfs-fs))) +(file-systems + (list (file-system + (device (file-system-label "root")) + (mount-point "/") + (type "ext4")) + (file-system + (device (file-system-label "btrfs")) + (mount-point "/btrfs") + (type "btrfs")))) + +(swap-devices + (list + (swap-space + (target "/btrfs/swapfile") + (dependencies (filter (file-system-mount-point-predicate "/btrfs") + file-systems))))) @end lisp -Use the file @file{/btrfs/swapfile} as swap space, which is present on the -@var{btrfs-fs} filesystem. +Use the file @file{/btrfs/swapfile} as swap space, which depends on the +file system mounted at @file{/btrfs}. Note how we use Guile's filter to +select the file system in an elegant fashion! @node User Accounts @section User Accounts -- 2.34.0