GNU Guix provides several Scheme programming interfaces (APIs) to define, build, and query packages. The first interface allows users to write high-level package definitions. These definitions refer to familiar packaging concepts, such as the name and version of a package, its build system, and its dependencies. These definitions can then be turned into concrete build actions.
Build actions are performed by the Guix daemon, on behalf of users. In a standard setup, the daemon has write access to the store—the /gnu/store directory—whereas users do not. The recommended setup also has the daemon perform builds in chroots, under specific build users, to minimize interference with the rest of the system.
Lower-level APIs are available to interact with the daemon and the store. To instruct the daemon to perform a build action, users actually provide it with a derivation. A derivation is a low-level representation of the build actions to be taken, and the environment in which they should occur—derivations are to package definitions what assembly is to C programs. The term “derivation” comes from the fact that build results derive from them.
This chapter describes all these APIs in turn, starting from high-level package definitions.
• 软件包模块 | 从程序员的角度看软件包。 | |
• 定义软件包 | 定义新软件包。 | |
• Defining Package Variants | Customizing packages. | |
• 书写清单 | The bill of materials of your environment. | |
• 构建系统 | 指定如何构建软件包。 | |
• Build Phases | Phases of the build process of a package. | |
• Build Utilities | Helpers for your package definitions and more. | |
• Search Paths | Declaring search path environment variables. | |
• 仓库 | 操纵软件包仓库。 | |
• Derivations | 软件包derivation的底层接口。 | |
• 仓库monad | 仓库的纯函数式接口。 | |
• G-表达式 | 操纵构建表达式。 | |
• 调用guix repl | Programming Guix in Guile | |
• Using Guix Interactively | Fine-grain interaction at the REPL. |