summaryrefslogtreecommitdiff
path: root/posts/2015-06-21-getting-started-with-guix.skr
blob: ddf3b946f2386130155722d75c2d0eec594939c6 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
(post
 :title "Getting started with GNU Guix"
 :date (string->date* "2015-06-21 00:00")
 :tags '("gnu"
         "planet-fsfe-en"
         "free software"
         "system administration"
         "packaging"
         "guix")

 (p [,(ref "/posts/2015-04-17-gnu-guix.html" "Previously I wrote")
     about how using GNU Guix in an HPC environment enables easy
     software deployment for multiple users with different needs when
     it comes to application and library versions.  Although Guix comes
     with an excellent manual which is also ,(ref
     "https://www.gnu.org/software/guix/manual/guix.html" "available
     online"), some people may want to have just some simple
     installation instructions in one place and some pointers to get
     started.  I’m attempting to provide just that with this article.])
 
 (p [While Guix can be built from source it is much more convenient to
     use the self-contained tarball which provides pre-built binaries
     for Guix and all its dependencies.  You need to have GNU tar and
     xz installed to unpack the tarball.  Note that the tarball will
     only work on GNU/Linux systems; it will not work on MacOS.])
 
 
 (h2 [Six simple steps])
 
 (p [,(em [First]), if you are using a 64 bit machine, download the
     compressed ,(ref
     "ftp://alpha.gnu.org/gnu/guix/guix-binary-0.8.2.x86_64-linux.tar.xz"
     "x86_64 archive from the FTP server").  There also is a ,(ref
     "ftp://alpha.gnu.org/gnu/guix/guix-binary-0.8.2.i686-linux.tar.xz"
     "tarball for 32 bit machines") and ,(ref
     "ftp://alpha.gnu.org/gnu/guix/guix-binary-0.8.2.mips64el-linux.tar.xz"
     "one for the less common MIPS").])
 
 (p [,(em [Second]), unpack the archive as root in the root directory:])
 
 (pre (code [# cd /
# tar xf guix-binary-0.8.2.SYSTEM.tar.xz]))
 
 (p [This creates a pre-populated store at ,(code [/gnu/store])
     (containing the “guix” package and the complete dependency graph),
     the ,(em [local state directory]) ,(code [/var/guix]), and a Guix
     profile for the root user at ,(code [/root/.guix-profile]), which
     contains the guix command line tools and the daemon.])
 
 (p [,(em [Third]), create a build user pool, as root:])
 
 (pre (code [# groupadd --system guix-builder
# for i in `seq 1 10`;
  do
    useradd -g guix-builder -G guix-builder           \
            -d /var/empty -s `which nologin`          \
            -c "Guix build user $i" --system          \
            guix-builder$i;
  done]))
 
 (p [These are the restricted user accounts which are used by the
     daemon to build software in a controlled environment.  You may not
     need ten, but it’s a good default.])
 
 (p [,(em [Fourth]), run the daemon and tell it about the ,(code
     [guix-builder]) group:])
 
 (pre (code [# /root/.guix-profile/bin/guix-daemon --build-users-group=guix-builder]))
 
 (p [,(em [Fifth]), make the ,(code [guix]) command available to other users
     on the machine by linking it to a location everyone can access,
     such as ,(code [/usr/local/bin]).])
 
 (pre (code [# mkdir -p /usr/local/bin
# cd /usr/local/bin
# ln -s /root/.guix-profile/bin/guix]))
 
 (p [Now any user—not just the almighty root—can install software by
     invoking ,(code [guix package -i whatever]).  Yay!])
 
 (p [,(em [Finally]), if you do not want to build all software locally
     (which can take a very long time) and you think you can trust the
     GNU Guix build farm hydra.gnu.org, authorise it as a source for
     so-called binary substitutes using the included public key:])
 
 (pre (code [# guix archive --authorize < /root/.guix-profile/share/guix/hydra.gnu.org.pub]))
 
 (p [Note that hydra.gnu.org isn’t at all special.  Packages are built
     there continuously from source.  Guix is flexible and can pull
     binary substitutes from other locations as long as you authorise
     them.])
 
 (h2 [Where to go from here])
 
 (p [Congratulations!  You now have a fully functional installation of
     the Guix package manager.])
 
 (p [To get the latest package recipes for Guix just run ,(code [guix
     pull]), which will download and compile the most recent
     development version.])
 
 (p [I recommend reading the excellent Guix reference manual, which is
     ,(ref "https://www.gnu.org/software/guix/manual/guix.html"
     "available on the web") and, of course, included as an Info
     document in your Guix installation.  If you don’t have Emacs—the
     best Info reader, which also happens to be an excellent text
     editor—I encourage you to install it from Guix; it is just a
     ,(code [guix package -i emacs]) away!])
 
 (p [If you have questions that are not covered by the manual feel free
     to chat with members of the Guix community ,(ref
     "https://webchat.freenode.net/?channels=#guix" "on IRC in the
     #guix channel on Freenode").  For matters relating to using Guix
     in a bioinformatics environment you are welcome to subscribe and
     write to the ,(ref
     "http://lists.open-bio.org/mailman/listinfo/bio-packaging"
     "mailing list bio-packaging@mailman.open-bio.org").]))