Mostly i like to talk about Guix Package Management
I plan to cover about
Total talk duration will be around 10 - 15 mins.
Guix - The fearless exploration/tinkering [or] Emacs
Mostly i like to talk about Guix Package Management, It need to short and crisp.
I plan to cover about
* Why Guix ?
- Transactional package management
- If you mess up during update or install you can roll back to previous commit
- Reproducible Build Environments
- Create a virtual environment for your project
- Pure environment
- we achieve it using ~manifest.scm~
- Unprivileged package management
- Guix allows any user to install and remove packages without requiring root privileges.
* Guix as foreign package manager
- Package are defined in Guile scheme
- May be show them, package definition for hello program
#+begin_src scheme
(use-modules (guix)
(guix build-system gnu)
(guix licenses))
(package
(name "hello")
(version "2.10")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnu/hello/hello-" version
".tar.gz"))
(sha256
(base32
"0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))
(build-system gnu-build-system)
(synopsis "Hello, GNU world: An example GNU package")
(description "Guess what GNU Hello prints!")
(home-page "http://www.gnu.org/software/hello/")
(license gpl3+))
#+end_src
- Install package
guix install <package>
- Update
guix upgrade <regex>
- Remove
guix remove <package>
- switch between generation
- guix package --roll-back (previous generation)
- guix package --switch-generation=+1/-1 (+ -> forward, - -> backward)
More info: https://guix.gnu.org/guix-refcard.pdf
* Packages
- Where to get packages? Channels
- Guix channel is just a git repo
- So you can lock to particular commit, branch. (for reproducibility)
- Also creating channel is pretty easy.
- Upgrading channels, it can be done using
guix pull
* User profile
- Guix profile refers to a directory containing the installed packages and
configuration specific to a particular user or system.
- Types
- Per user profile
- System profile
- use ~guix profile~ for this operation
* Like what you hear ? Then check out Guix distribution
* Emacs guix package [If time permits]
- simple demo, how to use emacs as guix front end
* Learn more
- Youtube: System Crafters, Andrew Tropin, Fosdem guix, (guix as youtube search)
- Guix cookbook and Manual
Hey, Remember to talk about expanding to other computers? It’s smooth – just grab that config file, and voila, everything syncs up across all machines. It’s a pro-level move for effortlessly keeping things consistent. As a newbie, I can vouch for it being a cool and user-friendly feature—simple enough for anyone to get and intriguing even for the little ones. Go ahead, spread the excitement about Guix!
a. how easy it is with guix to use the most recent version of a package, e.g. guix shell --with-latest=git git, a specific version of a package with a different source using --with-source=package@version=source (and other package transformation options as documented here => Package Transformation Options (GNU Guix Reference Manual)).
b. that guix actually makes an effort to query archive.org, softwareheritage.org and alike if the upstream source isn’t available on any other mirror anymore for a package is worth a mention as it solves availability issues for dependencies:
(guix230 (~)) λ guix build ed --with-source=mirror://gnu/ed/ed-0.9.tar.gz
Starting download of /tmp/guix-file.uln59E
From https://ftpmirror.gnu.org/gnu/ed/ed-0.9.tar.gz...
following redirection to `https://mirror.dogado.de/gnu/ed/ed-0.9.tar.gz'...
download failed "https://mirror.dogado.de/gnu/ed/ed-0.9.tar.gz" 404 "Not Found"
Starting download of /tmp/guix-file.uln59E
From ftp://ftp.cs.tu-berlin.de/pub/gnu/ed/ed-0.9.tar.gz...
In procedure getaddrinfo: Name or service not known
Starting download of /tmp/guix-file.uln59E
From ftp://ftp.funet.fi/pub/mirrors/ftp.gnu.org/gnu/ed/ed-0.9.tar.gz...
Throw to key `ftp-error' with args `(#<input-output: socket 18> "RETR ed-0.9.tar.gz" 550 "Can't open ed-0.9.tar.gz: No such file or directory\r")'.
Starting download of /tmp/guix-file.uln59E
From http://ftp.gnu.org/pub/gnu/ed/ed-0.9.tar.gz...
download failed "http://ftp.gnu.org/pub/gnu/ed/ed-0.9.tar.gz" 404 "Not Found"
Starting download of /tmp/guix-file.uln59E
From https://web.archive.org/web/20240302002532/https://ftpmirror.gnu.org/gnu/ed/ed-0.9.tar.gz...
download failed "https://web.archive.org/web/20240302002532/https://ftpmirror.gnu.org/gnu/ed/ed-0.9.tar.gz" 404 "NOT FOUND"
Trying to use Disarchive to assemble /tmp/guix-file.uln59E...
could not find its Disarchive specification
failed to download "/tmp/guix-file.uln59E" from "mirror://gnu/ed/ed-0.9.tar.gz"
c. guix import is definitely worth a mention:
(guix230 (~)) λ guix import cpan Data::Bool
Starting download of /tmp/guix-file.tgAr9P
From http://www.cpan.org/authors/id/F/FE/FERREIRA/Data-Bool-2.98014.tar.gz...
…98014.tar.gz 19KiB 13.8MiB/s 00:00 ▕██████████████████▏ 100.0%
(define-public perl-data-bool
(package
(name "perl-data-bool")
(version "2.98014")
(source
(origin
(method url-fetch)
(uri (string-append "mirror://cpan/authors/id/F/FE/FERREIRA/Data-Bool-"
version ".tar.gz"))
(sha256
(base32 "1v7j1dr16vhpsdzmwfydxmclxisipw6s6kw31m623syh0yvd8s9w"))))
(build-system perl-build-system)
(native-inputs (list perl-cpanel-json-xs perl-types-serialiser))
(home-page "https://metacpan.org/release/Data-Bool")
(synopsis "An interface to booleans as objects for Perl")
(description fill-in-yourself!)
(license perl-license)))
as guix comes with importers for many popular package registries (such as crates.io, cpan, elpa and so on), some of them offering recursive imports of packages with dependencies. Packaging software as a task is usually way more cumbersome in other package managers.
I’ve been using guix in debian for about two years (in alpine for a few months). Before I started using guix I was reluctant to replace (or complement) the official package manager of the distro. I would say that listing the advantages of the package manager is not very persuasive.
What convinced me to try guix was the talk “Guix: Unifying provisioning, deployment, and package management in the age of containers” basically describing guix as an exiting new technology (and a better docker), the many advantages are just a consequence of the fundamental design. So I would recommend trying to relate the package manager aspect to the bigger picture (maybe this suggestion is not as useful for a 15 minute talk).