diff options
author | Florian Pelz <pelzflorian@pelzflorian.de> | 2024-05-19 10:05:13 +0200 |
---|---|---|
committer | Florian Pelz <pelzflorian@pelzflorian.de> | 2024-05-19 19:09:40 +0200 |
commit | 9c3a8a380bcfebdb77af61532e7bfec523d7bde8 (patch) | |
tree | 3942645819b908d2ca598395d55b6ca84284f6bf /doc | |
parent | 0685042c4601e7e7a88aab9c1cbfbfb4092a5aa2 (diff) | |
download | guix-9c3a8a380bcfebdb77af61532e7bfec523d7bde8.tar guix-9c3a8a380bcfebdb77af61532e7bfec523d7bde8.tar.gz |
doc: cookbook: Fix overlong lines.
Fixes <https://issues.guix.gnu.org/63680>.
Thanks to Nigko Yerden for telling me ExecStart lines can be multi-line
<https://lists.gnu.org/archive/html/bug-guix/2024-05/msg00153.html>.
* doc/guix-cookbook.texi (System Configuration)
[Customizing the Kernel]: Split lines.
[Customizing a Window Manager]<StumpWM>: Likewise.
[Setting up a bind mount]: Move comments.
[Getting substitutes from Tor]: Split line with backslash.
[Music Server with Bluetooth Audio]: Likewise.
(Advanced package management)[Guix Profiles in Practice]
<Basic setup with manifests>: Likewise.
<Reproducible profiles>: Likewise.
(Environment management)[Guix environment via direnv]: Likewise.
(Installing Guix on a Cluster)[Setting Up a Head Node]:
On Info and PDF, split ExecStart= command with backslash.
Change-Id: I31ef5b0417b319c3f6946d65f83edafb86c8f36b
Diffstat (limited to 'doc')
-rw-r--r-- | doc/guix-cookbook.texi | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi index 3bc63cba7a..6b6f5460c3 100644 --- a/doc/guix-cookbook.texi +++ b/doc/guix-cookbook.texi @@ -23,7 +23,8 @@ Copyright @copyright{} 2020 Christine Lemmer-Webber@* Copyright @copyright{} 2021 Joshua Branson@* Copyright @copyright{} 2022, 2023 Maxim Cournoyer@* Copyright @copyright{} 2023-2024 Ludovic Courtès@* -Copyright @copyright{} 2023 Thomas Ieong +Copyright @copyright{} 2023 Thomas Ieong@* +Copyright @copyright{} 2024 Florian Pelz@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -1693,7 +1694,8 @@ declared like this: (make-linux-libre* linux-libre-5.15-version linux-libre-5.15-gnu-revision linux-libre-5.15-source - '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux") + '("x86_64-linux" "i686-linux" "armhf-linux" + "aarch64-linux" "riscv64-linux") #:configuration-file kernel-config)) @end lisp @@ -2405,9 +2407,11 @@ Then you need to add the following code to a StumpWM configuration file @lisp (require :ttf-fonts) (setf xft:*font-dirs* '("/run/current-system/profile/share/fonts/")) -(setf clx-truetype:+font-cache-filename+ (concat (getenv "HOME") "/.fonts/font-cache.sexp")) +(setf clx-truetype:+font-cache-filename+ (concat (getenv "HOME") + "/.fonts/font-cache.sexp")) (xft:cache-fonts) -(set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Book" :size 11)) +(set-font (make-instance 'xft:font :family "DejaVu Sans Mono" + :subfamily "Book" :size 11)) @end lisp @node Session lock @@ -2963,13 +2967,14 @@ should be defined, so that the bind mount can depend on it. (file-system (device (uuid "UUID goes here")) (mount-point "/path-to-spinning-disk-goes-here") - (type "ext4"))) ;; Make sure to set this to the appropriate type for your drive. + (type "ext4"))) ;Make sure to set this to the appropriate type for your drive. @end lisp The source folder must also be defined, so that guix will know it's not a regular block device, but a folder. @lisp -(define (%source-directory) "/path-to-spinning-disk-goes-here/tmp") ;; "source-directory" can be named any valid variable name. +;; "source-directory" can be named any valid variable name. +(define (%source-directory) "/path-to-spinning-disk-goes-here/tmp") @end lisp Finally, inside the @code{file-systems} definition, we must add the @@ -2980,14 +2985,18 @@ mount itself. ...<other drives omitted for clarity>... - source-drive ;; Must match the name you gave the source drive in the earlier definition. + ;; Must match the name you gave the source drive in the earlier definition. + source-drive (file-system - (device (%source-directory)) ;; Make sure "source-directory" matches your earlier definition. + ;; Make sure "source-directory" matches your earlier definition. + (device (%source-directory)) (mount-point "/tmp") - (type "none") ;; We are mounting a folder, not a partition, so this type needs to be "none" + ;; We are mounting a folder, not a partition, so this type needs to be "none" + (type "none") (flags '(bind-mount)) - (dependencies (list source-drive)) ;; Ensure "source-drive" matches what you've named the variable for the drive. + ;; Ensure "source-drive" matches what you've named the variable for the drive. + (dependencies (list source-drive)) ) ...<other drives omitted for clarity>... @@ -3036,8 +3045,8 @@ follow: config => (guix-configuration (inherit config) ;; ci.guix.gnu.org's Onion service - (substitute-urls - "@value{SUBSTITUTE-TOR-URL}") + (substitute-urls "\ +@value{SUBSTITUTE-TOR-URL}") (http-proxy "http://localhost:9250"))))))) @end lisp @@ -3279,12 +3288,14 @@ that should accomplish the above-mentioned tasks: #~(string-append "\ # Declare Bluetooth audio device type \"bluealsa\" from bluealsa module pcm_type.bluealsa @{ - lib \"" #$(file-append bluez-alsa "/lib/alsa-lib/libasound_module_pcm_bluealsa.so") "\" + lib \"" +#$(file-append bluez-alsa "/lib/alsa-lib/libasound_module_pcm_bluealsa.so") "\" @} # Declare control device type \"bluealsa\" from the same module ctl_type.bluealsa @{ - lib \"" #$(file-append bluez-alsa "/lib/alsa-lib/libasound_module_ctl_bluealsa.so") "\" + lib \"" +#$(file-append bluez-alsa "/lib/alsa-lib/libasound_module_ctl_bluealsa.so") "\" @} # Define the actual Bluetooth audio device. @@ -4076,7 +4087,8 @@ We can create a manifest specification per profile and install them this way: @example GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles mkdir -p "$GUIX_EXTRA_PROFILES"/my-project # if it does not exist yet -guix package --manifest=/path/to/guix-my-project-manifest.scm --profile="$GUIX_EXTRA_PROFILES"/my-project/my-project +guix package --manifest=/path/to/guix-my-project-manifest.scm \ + --profile="$GUIX_EXTRA_PROFILES"/my-project/my-project @end example Here we set an arbitrary variable @samp{GUIX_EXTRA_PROFILES} to point to the directory @@ -4149,7 +4161,8 @@ for the command line options. To upgrade a profile, simply install the manifest again: @example -guix package -m /path/to/guix-my-project-manifest.scm -p "$GUIX_EXTRA_PROFILES"/my-project/my-project +guix package -m /path/to/guix-my-project-manifest.scm \ + -p "$GUIX_EXTRA_PROFILES"/my-project/my-project @end example To upgrade all profiles, it's easy enough to loop over them. For instance, @@ -4159,7 +4172,8 @@ of the profile (e.g.@: "project1"), you could do the following in Bourne shell: @example for profile in "$GUIX_EXTRA_PROFILES"/*; do - guix package --profile="$profile" --manifest="$HOME/.guix-manifests/guix-$profile-manifest.scm" + guix package --profile="$profile" \ + --manifest="$HOME/.guix-manifests/guix-$profile-manifest.scm" done @end example @@ -4337,7 +4351,9 @@ mkdir -p "$GUIX_EXTRA"/my-project guix pull --channels=channel-specs.scm --profile="$GUIX_EXTRA/my-project/guix" mkdir -p "$GUIX_EXTRA_PROFILES/my-project" -"$GUIX_EXTRA"/my-project/guix/bin/guix package --manifest=/path/to/guix-my-project-manifest.scm --profile="$GUIX_EXTRA_PROFILES"/my-project/my-project +"$GUIX_EXTRA"/my-project/guix/bin/guix package \ + --manifest=/path/to/guix-my-project-manifest.scm \ + --profile="$GUIX_EXTRA_PROFILES"/my-project/my-project @end example It's safe to delete the Guix channel profile you've just installed with the @@ -5071,7 +5087,8 @@ use_guix() PACKAGES=(help2man guile-sqlite3 guile-gcrypt) # Thanks <https://lists.gnu.org/archive/html/guix-devel/2016-09/msg00859.html> - eval "$(guix environment --search-paths --root="$gcroot" --pure guix --ad-hoc $@{PACKAGES[@@]@} $@{PACKAGES_MAINTENANCE[@@]@} "$@@")" + eval "$(guix shell --search-paths --root="$gcroot" --pure guix \ + $@{PACKAGES[@@]@} $@{PACKAGES_MAINTENANCE[@@]@} "$@@")" # Predefine configure flags. configure() @@ -5178,9 +5195,21 @@ startup file for @command{guix-daemon}, @code{--listen} argument to the @code{ExecStart} line so that it looks something like this: +@c Since Debian Buster, \ is documented to split lines. +@c https://manpages.debian.org/buster/systemd/systemd.exec.5.en.html +@c Use it in PDF and Info versions to avoid cut-off at the page border. +@ifnothtml +@example +ExecStart=/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon \ + --build-users-group=guixbuild \ + --listen=/var/guix/daemon-socket/socket --listen=0.0.0.0 +@end example +@end ifnothtml +@ifhtml @example ExecStart=/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild --listen=/var/guix/daemon-socket/socket --listen=0.0.0.0 @end example +@end ifhtml For these changes to take effect, the service needs to be restarted: |