···
$ cd <replaceable>/my/sources</replaceable>
$ git clone git://github.com/NixOS/nixpkgs.git
+
$ git remote add channels git://github.com/NixOS/nixpkgs-channels.git
+
$ 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
+
repository.) The remote <literal>channels</literal> refers to a
+
read-only repository that tracks the Nixpkgs/NixOS channels (see <xref
+
linkend="sec-upgrading"/> for more information about channels). Thus,
+
the Git branch <literal>channels/nixos-14.12</literal> will contain
+
the latest built and tested version available in the
+
<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:
+
14.04.273.ea1952b (Baboon)
+
$ git checkout -b local ea1952b
+
Or, to base your local branch on the latest version available in a
+
$ git remote update channels
+
$ git checkout -b local channels/nixos-14.12
+
(Replace <literal>nixos-14.12</literal> with the name of the channel
+
you want to use.) You can use <command>git merge</command> or
+
<command>git rebase</command> to keep your local branch in sync with
+
$ git remote update channels
+
$ git merge channels/nixos-14.12
+
You can use <command>git cherry-pick</command> to copy commits from
+
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