···
$ cd <replaceable>/my/sources</replaceable>
$ git clone git://github.com/NixOS/nixpkgs.git
28
+
$ git remote add channels git://github.com/NixOS/nixpkgs-channels.git
29
+
$ git remote update channels
This will check out the latest NixOS sources to
···
and the Nixpkgs sources to
<filename><replaceable>/my/sources</replaceable>/nixpkgs</filename>.
(The NixOS source tree lives in a subdirectory of the Nixpkgs
37
+
repository.) The remote <literal>channels</literal> refers to a
38
+
read-only repository that tracks the Nixpkgs/NixOS channels (see <xref
39
+
linkend="sec-upgrading"/> for more information about channels). Thus,
40
+
the Git branch <literal>channels/nixos-14.12</literal> will contain
41
+
the latest built and tested version available in the
42
+
<literal>nixos-14.12</literal> channel.</para>
<para>It’s often inconvenient to develop directly on the master
branch, since if somebody has just committed (say) a change to GCC,
···
branch based on your current NixOS version:
43
-
$ <replaceable>/my/sources</replaceable>/nixpkgs/maintainers/scripts/update-channel-branches.sh
44
-
Fetching channels from https://nixos.org/channels:
45
-
* [new branch] cbe467e -> channels/remotes/nixos-unstable
46
-
Fetching channels from nixos-version:
47
-
* [new branch] 9ff4738 -> channels/current-system
48
-
Fetching channels from ~/.nix-defexpr:
49
-
* [new branch] 0d4acad -> channels/root/nixos
50
-
$ git checkout -b local channels/current-system
52
+
14.04.273.ea1952b (Baboon)
54
+
$ git checkout -b local ea1952b
53
-
Or, to base your local branch on the latest version available in the
57
+
Or, to base your local branch on the latest version available in a
57
-
$ <replaceable>/my/sources</replaceable>/nixpkgs/maintainers/scripts/update-channel-branches.sh
58
-
$ git checkout -b local channels/remotes/nixos-unstable
61
+
$ git remote update channels
62
+
$ git checkout -b local channels/nixos-14.12
61
-
You can then use <command>git rebase</command> to sync your local
62
-
branch with the upstream branch, and use <command>git
63
-
cherry-pick</command> to copy commits from your local branch to the
64
-
upstream branch.</para>
65
+
(Replace <literal>nixos-14.12</literal> with the name of the channel
66
+
you want to use.) You can use <command>git merge</command> or
67
+
<command>git rebase</command> to keep your local branch in sync with
71
+
$ git remote update channels
72
+
$ git merge channels/nixos-14.12
75
+
You can use <command>git cherry-pick</command> to copy commits from
76
+
your local branch to the upstream branch.</para>
<para>If you want to rebuild your system using your (modified)
sources, you need to tell <command>nixos-rebuild</command> about them