mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-02-07 11:29:59 +01:00
doc: Clarify the Swap Space examples, and include an helper example.
* 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. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
0055a803e2
commit
cfa6fdc54c
1 changed files with 25 additions and 8 deletions
|
@ -15742,22 +15742,39 @@ Linux swap partition by running @command{swaplabel @var{device}}, where
|
||||||
@lisp
|
@lisp
|
||||||
(swap-space
|
(swap-space
|
||||||
(target (file-system-label "swap"))
|
(target (file-system-label "swap"))
|
||||||
(dependencies (list lvm-device)))
|
(dependencies mapped-devices))
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
Use the partition with label @code{swap}, which can be found after the
|
Use the partition with label @code{swap}, which can be found after all
|
||||||
@var{lvm-device} mapped device has been opened. Again, the
|
the @var{mapped-devices} mapped devices have been opened. Again, the
|
||||||
@command{swaplabel} command allows you to view and change the label of a
|
@command{swaplabel} command allows you to view and change the label of a
|
||||||
Linux swap partition.
|
Linux swap partition.
|
||||||
|
|
||||||
|
Here's a more involved example with the corresponding @code{file-systems} part
|
||||||
|
of an @code{operating-system} declaration.
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
(swap-space
|
(file-systems
|
||||||
(target "/btrfs/swapfile")
|
(list (file-system
|
||||||
(dependencies (list btrfs-fs)))
|
(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
|
@end lisp
|
||||||
|
|
||||||
Use the file @file{/btrfs/swapfile} as swap space, which is present on the
|
Use the file @file{/btrfs/swapfile} as swap space, which depends on the
|
||||||
@var{btrfs-fs} filesystem.
|
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
|
@node User Accounts
|
||||||
@section User Accounts
|
@section User Accounts
|
||||||
|
|
Loading…
Add table
Reference in a new issue