- A Scheme Primer: for a basic understanding of Scheme
- Guile 3.0 Manual: The most important part of this manual is API Reference, when in doubt, check the API Reference.
How to practice Guile Scheme Language(on NixOS):
nix shell nixpkgs#racket-minimal --command "racket"Tutorials for Guix itself:
- GNU Guix Reference Manual: read this first for installation and basic usage & setup.
- GNU Guix Cookbook: read this after you have your Guix installed and have some basic knowledge about Guix.
How to use Guix on NixOS: https://github.com/ryan4yin/nix-config/blob/main/modules/nixos/desktop/guix.nix
'a: a syntax sugar of(quote a), a symbolais not evaluated.#tand#f: true and false'()ornull: empty list(list arg1 arg2 …)or'(arg1 arg2 …): a linked list,cons* arg1 arg2 …: similar to(list arg1 arg2 …), but its last cons cell is a dotted list, which does not havenullfor its cdr.- This function is called
list*in some other Schemes and in Common LISP.
- This function is called
scheme@(guile-user)> (cons* 1 2 3 4 5)
$4 = (1 2 3 4 . 5)
scheme@(guile-user)> (list 1 2 3 4 5)
$5 = (1 2 3 4 5)
scheme@(guile-user)> '(1 2 3 4 5)
$6 = (1 2 3 4 5)
scheme@(guile-user)> '(1 2)
$7 = (1 2)
scheme@(guile-user)> (cons 1 (cons 2 '()))
$8 = (1 2)
;; a list which does not have `null` for its cdr is called a dotted list.
scheme@(guile-user)> (cons 1 2)
$9 = (1 . 2)conscreates a pair with two elements: itscarandcdr(list a b ...)creates a linked list with multiple elements, and anullis appended to the end(cons* a b ... g h)creates a linked list with multiple elements, but the last element is notnull
cons* is useful when you want to insert multiple elements at the front of a list. For example:
(cons* 1 2 3 '(4 5 6)) will insert 1 2 3 at the front of (4 5 6), resulting in (1 2 3 4 5 6)
nonguix’s installation description uses cons* ... %default-channels to insert its channel before Guix’s default
channels.
If we use list ... %default-channels, the result has an extra null at the end, which is not what we want.
scheme@(guile-user) [1]> (list 1 2 3 (list 4 5 6))
$13 = (1 2 3 (4 5 6))
scheme@(guile-user) [1]> '(1 2 3 (4 5 6))
$14 = (1 2 3 (4 5 6))
scheme@(guile-user) [1]> (cons* 1 2 3 (list 4 5 6))
$15 = (1 2 3 4 5 6)guix search <package-name>to find the package’s location- For example,
guix search kittywill show the package’s location isgnu/packages/terminals.scm
- For example,
- Add
(use-package-modules terminals)to the top ofconfig.scm - Add
kittyto thepackageslist inconfig.scm
- Documentation for
use-modules(provided by Guile): https://www.gnu.org/software/guile/manual/html_node/Using-Modules.html - Documentation for
use-service-modules,use-package-modules&use-system-modules: No official docs, but you can read their definition in source code: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu.scm#n143 - Source code:
Learn more: https://guix.gnu.org/manual/en/html_node/Channels-with-Substitutes.html
When executing guix pull, Guix initially compiles the definitions of every available package. This is a resource-intensive
process for which substitutes may be accessible.
For nonguix, you can enhance the speed of guix pull by incorporating its official substitutes. Refer to the ‘substitutes’ section in https://gitlab.com/nonguix/nonguix for details.
In NixOS,
nixundergoes no compilation phase and functions as a fully interpreted language. Consequently,nix flake updateoutpacesguix pullin terms of speed.
The substitutes you integrate into config.scm will become effective only after the initial completion of guix system reconfigure!
For expediting the inaugural reconfiguration, consult nonguix’s official README.
guix system reconfigure by introducing nonguix’s substitutes.
Learn more: https://www.gnu.org/software/guile/manual/html_node/Modules.html
Try guix pull and then guix package -u to update the packages.
- https://github.com/engstrand-config/guix-dotfiles
- https://github.com/migalmoreno/guix-config
- https://github.com/Tass0sm/dotfiles
- https://github.com/yveszoundi/guix-config
- https://github.com/hiecaq/guix-config
- https://github.com/rakino/Rosenthal: A certain Guix channel
- https://spritely.institute/static/papers/scheme-primer.html
- https://toys.whereis.xn–q9jyb4c/
- https://systemcrafters.net/