about summary refs log tree commit diff
path: root/doc/install.xml
blob: 88a0838f3e42c9f6dae6a30fdb75cdcebba95f97 (plain) (blame)
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
<?xml version="1.0"?>
<!DOCTYPE book [
<!ENTITY % entities SYSTEM "entities.ent">
%entities;
]>
<part xmlns="http://docbook.org/ns/docbook"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <title>Installing a machine in Vuizvui</title>

  <para>
    The easiest way to get started is if the machine is already in Vuizvui so
    there is a channel available.
  </para>

  <para>
    You can have a look at
    <link xlink:href="&hydra.base;/jobset/openlab/vuizvui#tabs-channels">the
      list of channels</link>
    to check whether a channel exists for the machine you want to install.
  </para>

  <para>
    So let's say you want to install the machine <literal>schnurrkadse</literal> which
    has the channel attribute <literal>channels.machines.sternenseemann.schnurrkadse</literal>
  </para>

  <para>
    First you need to add the channel for the
    <systemitem class="username">root</systemitem> user of your current system
    using the following commands:

    <command>
<screen>
nix-channel --add <link
  xlink:href="&hydra.channelbase;/channels.machines.sternenseemann.schnurrkadse"/> vuizvui
nix-channel --remove nixos  # otherwise it will interfere with the rebuild
nix-channel --update
</screen>
    </command>

    Notice the <literal>vuizvui</literal> argument at the end of the first
    command. This makes the channel available as
    <literal>&lt;vuizvui&gt;</literal> in the search path of the current system.
  </para>

  <para>
    For the first installation the <envar>NIX_PATH</envar> isn't correctly set
    and will be set to include the <literal>vuizvui</literal> channel after
    you've switched to the configuration for the first time.
  </para>

  <para>
    Next put the following in your
    <filename>/etc/nixos/configuration.nix</filename>:
  </para>

  <screen><code language="nix">(import &lt;vuizvui/machines&gt;).sternenseemann.schnurrkadse.config</code></screen>

  <para>
    Of course you need to replace <literal>sternenseemann.schnurrkadse</literal> with the
    attribute of your machine.
  </para>

  <para>
    Now in order to do the first build and activation of the configuration, you
    need to issue the following command as root:
  </para>

  <!-- FIXME: This WON'T work because of wrong NIX_PATH and missicg binary
              cache public key! -->
  <!-- TODO: create a bootsrap script that does this automatically -->
  <screen><command>nixos-rebuild \
  -I nixpkgs=/nix/var/nix/profiles/per-user/root/channels/vuizvui/nixpkgs \
  --option binary-cache-public-keys "headcounter.org:/7YANMvnQnyvcVB6rgFTdb8p5LG1OTXaO+21CaOSBzg=" \
      switch</command></screen>

  <para>
    We redefine <literal>nixpkgs</literal> here, because vuizvui brings its own nixpkgs that gets build on the hydra, using it we get to download from the binary cache. Additionally, we need to manually specify the public key for the <literal>headcounter.org</literal> hydra.
  </para>
</part>