Created: 2019-03-19 mar. 17:32
Tout conteneuriser ?
“Debian and other distributions
are going to be that thing you
run docker on, little more.”
Jos Poortvliet, développeur ownCloud
Pas besoin d'être root
guix package -i gcc-toolchain openmpi hwloc
Transactionnel
guix package --roll-back
Permet d'expérimenter
guix package --profile=./experiment -i gcc-toolchain@5.5 hwloc@1
Gestion des paquets (version control)
guix package --manifest=my-packages.scm
(specifications->manifest
'("gcc-toolchain"
"emacs"
"guile"
"emacs-geiser"))
Je me fais mon environnement de travail
bob@laptop$ guix package --manifest=my-packages.scm
Quelle version de Guix j'utilise ?
bob@laptop$ guix describe
guix cabba9e
repository URL: https://git.sv.gnu.org/git/guix.git
commit: cabba9e15900d20927c1f69c6c87d7d2a62040fe
Alice peut le reproduire exactement
alice@laptop$ guix pull --commit=cabba9e
alice@laptop$ guix package --manifest=my-packages.scm
On le télécharge
guix build -S hello
/gnu/store/...-hello-2.10.tar.gz
'guix environment' donne tous les outils nécessaires pour le compiler (gcc, make…)
~/hello-2.10$ guix environment hello
On compile
~/hello-2.10$ ./configure && make
On se met dans le bon environnement
~$ guix environment --ad-hoc python python-numpy
Et on fait notre test
~$ python3
>>> import numpy
On déclare tout ce qu'on veut avoir dans notre système
(operating-system
(host-name "schememachine")
(timezone "Europe/Paris")
(locale "fr_FR.utf8")
(bootloader (\alert{bootloader-configuration}
(bootloader grub-efi-bootloader)
(target "/boot/efi")))
(file-systems (cons (\alert{file-system}
(device (file-system-label "my-root"))
(mount-point "/")
(type "ext4"))
%base-file-systems))
(users (cons (\alert{user-account}
(name "charlie")
(group "users")
(home-directory "/home/charlie"))
%base-user-accounts))
(services (cons* (\alert{service} dhcp-client-service-type)
(\alert{service} openssh-service-type)
%base-services)))
Et on instancie, un peu à la Ansible
guix system build config.scm
guix system vm config.scm
guix system container config.scm
guix system reconfigure config.scm