maintenance/doc/refcard/guix-refcard.lout

345 lines
13 KiB
Plaintext
Raw Blame History

@Database @FontDef { gentium-fonts }
@Database @FontDef { charis-fonts }
@Database @FontDef { cm-fonts }
@Include { refcard-style.lout }
@IncludeGraphicRepeated { Guix-horizontal-print.eps }
def @Var right x { { GentiumPlus Slope } @Font x }
def @Dots { @Var { ... } }
def @Category named @Title {} body @Body {
@LP { @Heading { @Title } @LP { @Body } }
//1.1fx
}
macro @C { @DP @CNP @Category @Title }
def @URL right x {
x @ExternalLink { @I x }
}
def @Command named @Cmd {} right description {
{ @F @Cmd }
|5.0ct 3.8c @Wide { { oragged hyphen setoutdent 0.2c } @Break { description &1rt } }
}
macro @Entry { @LP @Command @Cmd }
def @LongCommand named @Cmd {} right description {
{ @F @Cmd } //1fx
|5ft { &0c description }
}
macro @LEntry { @LP @LongCommand @Cmd }
macro @Footer {
@LP
@VExpand { }
@LP
@Right { 0.5 @Scale { @IncludeGraphic { Guix-horizontal-print.eps } } }
}
@Document
@InitialFont { GentiumPlus Base 9p }
@InitialLanguage { English }
@InitialBreak { 1.2fx ragged unbreakablefirst unbreakablelast hyphen marginkerning }
@OptimizePages { Yes }
@PageHeaders { None }
//
@Text @Begin
@Heading { 1.5f @Font { GNU Guix Reference Card } }
//1.4fx { for version 1.3.0-19751-ge640da33f3 }
//1.2fx
@URL{ "https://guix.gnu.org/" }
//2fx
@C { Getting Started }
@Begin
@LP
To read the on-line documentation run @F { info~guix } or
visit @URL { "https://gnu.org/s/guix/manual/en/html_node" }. See @URL {
"https://emacs-guix.gitlab.io/website/" } for an Emacs interface to Guix.
@End @Category
@C { Specifying Packages }
@Begin
@LP
Most commands take a ``package specification'' denoted @Var { spec } in
the sequel. Here are some examples:
@LP
@Entry { emacs } { Emacs package, latest version }
@Entry { "gcc-toolchain@7" } { GCC toolchain, version 7.x }
@Entry { "gcc-toolchain:debug" } { latest GCC toolchain, debugging symbols }
@End @Category
@C { Managing Packages }
@Begin
@Entry { guix search @Var { regexp } @Dots } { search for packages }
@Entry { guix show @Var { spec } } { show package info }
@Entry { guix install @Var { spec }@Dots } { install packages }
@Entry { guix upgrade [@Var { regexp }] } { upgrade packages }
@Entry { guix remove @Var { name}@Dots } { remove packages }
@Entry { guix package -m @Var { file } } { instantiate from manifest }
@Entry { guix package "--"roll-back } { roll back }
@Entry { guix package -l } { list profile generations }
@Entry { guix package "--"search-paths } { display search paths }
@Entry { guix package -p @Var { profile } @Dots } { use a different profile }
@End @Category
@C { Manifests }
@Begin
@F { guix package -m } and other commands take a ``manifest'' file listing
packages of interest, along these lines:
@ID 0.9f @Font 1.1fx @Break @F
@Verbatim {
(specifications->manifest
'("gcc-toolchain@7" "gcc-toolchain@7:debug"
"openmpi"))
}
@End @Category
@C { One-Off Environments }
@Begin
@LEntry { guix shell @Var { spec }@Dots } {
environment containing @Var { spec }@Dots }
@LEntry { guix shell -D python } { environment to develop Python itself }
@LEntry { guix shell python -C "--" python3 } { run Python in a container }
@LEntry { guix shell "--"check } { check if the shell clobbers environment variables }
@LEntry { guix shell -m @Var { file } } { create an environment
for the packages in manifest @Var { file } }
@End @Category
@C { Updating Guix }
@Begin
@Entry { guix describe } { describe current Guix }
#@Entry { guix describe -f channels } { produce a channel spec }
@Entry { guix pull } { update Guix }
@Entry { guix pull -l } { view history }
@Entry { guix pull "--"commit=@Var { commit } } { update to @Var { commit } }
@Entry { guix pull "--"branch=@Var { branch } } { update to @Var { branch } }
@Entry { guix pull -C @Var { file } } { update the given channels }
@End @Category
@C { Channel Specifications }
@Begin
Channels specify Git repositories where @F { guix pull } looks for updates to
Guix and external package repositories. By default @F { guix pull }
reads @F { "~/.config/guix/"channels.scm }; with @F { -C } it can take channel specifications
from a user-supplied file that looks like this:
@ID 0.9f @Font 1.1fx @Break @F
@Verbatim{
(cons (channel
(name 'guix-hpc)
(url "https://gitlab.inria.fr/guix-hpc/guix-hpc.git")
(branch "master"))
%default-channels)
}
@End @Category
@C { Managing Storage Space }
@Begin
@Entry { guix gc } { collect all garbage }
@Entry { guix gc -C {@Var{n}}G } { collect @Var{n} GB of garbage }
@Entry { guix gc -F {@Var{n}}G } { ensure @Var{n} GB are available }
@Entry { guix gc -d @Var { duration } } { delete generations
older than @Var { duration }---e.g., @F { 1m } for one month }
@Entry { guix size @Var { spec } @Dots } { view package size }
@Entry { guix gc -R "/gnu/store/"@Dots } { list run-time dependencies }
@Entry { guix graph -t references @Var { spec } @Dots } { view run-time dependencies }
@End @Category
@C { Customizing Packages }
@Begin
@LEntry { guix @Var {command} @Var { name } "--"with-source=@Var { name }=@Var { source} }
{ build @Var { name } with a different source URL }
@LEntry { guix @Var {command} @Var { spec } "--"with-input=@Var { spec1 }=@Var {
spec2} }
{ replace @Var { spec1 } with @Var { spec2 } in the dependency graph of
@Var { spec } }
@LEntry { guix @Var { command } @Var { spec } "--"with-graft=@Var { spec1 }=@Var {
spec2} }
{ graft @Var { spec2 } in lieu of @Var { spec1 } in @Var { spec } }
@LEntry { guix @Var { command } "--"with-git-url=@Var { spec }=@Var { URL } }
{ build @Var { spec } from the given Git @Var { URL } }
@LEntry { guix @Var { command } @Var { spec } "--"with-branch={ @Var { package }={ @Var { branch } } } }
{ build @Var { spec } from the given Git @Var { branch } of @Var { package } }
@LEntry { guix @Var { command } @Var { spec } "--"with-commit={ @Var { package }={ @Var { commit } } } }
{ build @Var { spec } from the given Git @Var { commit } of @Var { package } }
@LEntry { guix @Var { command } @Var { spec } "--"with-patch={ @Var { package }={ @Var { file } } } }
{ build @Var { spec } after applying the given patch @Var { file } to @Var { package } }
@LEntry { guix @Var { command } @Var { spec } "--"with-latest={ @Var { package } } }
{ build @Var { spec } using the latest upstream release for @Var { package } }
@LEntry { guix @Var { command } @Var { spec } "--"with-c-toolchain={ @Var { package }={ @Var { toolchain } } } }
{ build @Var { spec } using @Var{ toolchain } for @Var { package } }
@LEntry { guix @Var { command } @Var { spec } "--"without-tests={ @Var { package } } }
{ build @Var { spec } without running the tests for @Var { package } }
@End @Category
@C { Developing Packages }
@Begin
@Entry { guix edit @Var { spec } } { view the definition }
@Entry { guix build @Var { spec } @Dots } { build packages }
@Entry { guix build "--"log-file @Var { spec } } { view the build log }
@Entry { guix build "-K" @Var { spec } @Dots } { build packages,
keep build trees on failure }
@Entry { guix build -S @Var { spec } } { obtain the source of @Var {
spec } }
@Entry { guix build "--"check @Var { spec } } { rebuild a package }
@Entry { guix build "--"target=@Var{ triplet } @Dots } { cross-compile to
@Var { triplet }---e.g., @F "arm-linux-gnueabihf" }
@Entry { guix download @Var { URL } } { download from @Var{ URL } and
print its SHA256 hash }
@Entry { guix hash @Var { file } } { print the hash of @Var { file } }
@Entry { guix graph @Var { spec } "|" dot -Tpdf @Dots } { view dependencies }
@Entry { guix refresh @Var { spec } } { update package definition }
@Entry { guix import @Var{ repo } @Var { name } } { import
@Var{name} from @Var { repo } }
@End @Category
@C { Creating Application Bundles }
@Begin
@Entry { guix pack @Var { spec } @Dots } { create a tarball }
@Entry { guix pack -f docker @Var { spec } @Dots } { create a Docker image }
@Entry { guix pack -f squashfs @Var { spec } @Dots } { create a Singularity image }
@Entry { guix pack -f deb @Var { spec } @Dots } { create a Debian package archive }
@Entry { guix pack -RR @Var { spec } @Dots } { create a relocatable tarball }
@Entry { guix pack -S "/bin"=bin @Var { spec } @Dots } { make @F
"/bin" a symlink to the packages' @F "bin" directory }
@Entry { guix pack -m @Var { file } } { bundle the packages from the
manifest in @Var { file } }
@End @Category
@Footer
# ------------------------------------------------------------------------------
@C { Managing the Operating System }
@Begin
@LEntry { guix system search @Var { regexp } }
{ search for services matching @Var { regexp } }
@LEntry { guix system reconfigure @Var { file } }
{ reconfigure the OS according to the configuration in @Var { file } }
@LEntry { guix system list-generations [@Var { pattern }] }
{ list OS generations matching @Var { pattern }---e.g., @F { 1m } for one
month }
@LEntry { guix system roll-back }
{ roll back to the previous system generation }
@LEntry { guix system delete-generations @Var { pattern } }
{ delete generations matching @Var { pattern } }
@LEntry { guix system build @Var { file } }
{ build the OS declared in @Var { file } }
@End @Category
@C { Building and Running Containers }
@Begin
@LEntry { guix system container @Var { file } }
{ produce a script that runs the OS declared in @Var { file } in a
container }
@LEntry { guix system docker-image @Var { file } }
{ build a Docker image of the OS declared in @Var { file } }
@End @Category
@C { Building Virtual Machines }
@Begin
@LEntry { guix system vm @Var { file } }
{ produce a script that runs the OS declared in @Var { file } in a VM }
@LEntry { guix system vm-image @Var { file } }
{ produce a QCOW2 image of the OS in @Var { file } }
@End @Category
@C { Building Operating System Images }
@Begin
@LEntry { guix system disk-image @Var { file } }
{ create a raw disk image for the OS declared in @Var { file } }
@LEntry { guix system disk-image {-}{-}file-system-type=iso9660 @Var { file } }
{ create an ISO CD"/"DVD image for the OS declared in @Var { file } }
@End @Category
@C { Inspecting an Operating System }
@Begin
@LEntry { guix system extension-graph @Var { file } }
{ show the graph of services extensions for the OS in @Var {
file } }
@LEntry { guix system shepherd-graph @Var { file } }
{ show the dependency graph of Shepherd services for @Var { file } }
@End @Category
@VExpand { }
@LP
0.5 @Scale { @IncludeGraphic { Guix-horizontal-print.eps } }
@C { Declaring an Operating System }
@Begin
@F { guix system } takes a configuration file that declares the @I {
complete } configuration of an operating system, along these lines:
@LP
@ID 0.9f @Font 1.1fx @Break @F
@Verbatim {
(use-modules (gnu))
(use-service-modules networking ssh)
(use-package-modules certs screen)
(operating-system
(host-name "gnu")
(timezone "Europe/Berlin")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us" "altgr-intl"))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(target (list "/boot/efi"))
(keyboard-layout keyboard-layout)))
(file-systems (cons (file-system
(device (file-system-label "my-root"))
(mount-point "/")
(type "ext4"))
%base-file-systems))
(users (cons (user-account
(name "charlie")
(comment "Charlie Smith")
(group "users")
(supplementary-groups '("wheel"
"audio" "video")))
%base-user-accounts))
;; Globally installed packages.
(packages (append (list screen nss-certs)
%base-packages))
;; System services: add sshd and DHCP to the base services.
(services (append (list (service dhcp-client-service-type)
(service openssh-service-type
(openssh-configuration
(port-number 2222))))
%base-services)))
}
@End @Category
@NP
@VExpand { }
@LP
7p @Font 1fx @Break { Copyright @CopyRight 2018, 2019, 2020 Ludovic Court<72>s <@I{"ludo@gnu.org"}>
@LP
Permission is granted to copy, distribute and"/"or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is
available at @URL "https://gnu.org/licenses/gfdl.html".
@LP
# Give a link to the 'Transparent Copy', as per Section 3 of the GFDL.
The source of this document is available from
@URL { "https://git.sv.gnu.org/cgit/guix/maintenance.git" }.
}
@End @Text