3
0
Fork 0
forked from mirrors/nixpkgs

Manual: Don't tell users to delete ~/.nix-defexpr/channels

That breaks nix-channel, obviously.
This commit is contained in:
Eelco Dolstra 2013-10-31 20:52:40 +01:00
parent 8e6abe49cd
commit 139ff6d52f

View file

@ -3,7 +3,7 @@
<title>Development</title> <title>Development</title>
<para>This chapter has some random notes on hacking on <para>This chapter describes how you can modify and extend
NixOS.</para> NixOS.</para>
@ -11,7 +11,7 @@ NixOS.</para>
<section> <section>
<title>Hacking on NixOS</title> <title>Getting the sources</title>
<para>By default, NixOSs <command>nixos-rebuild</command> command <para>By default, NixOSs <command>nixos-rebuild</command> command
uses the NixOS and Nixpkgs sources provided by the uses the NixOS and Nixpkgs sources provided by the
@ -34,12 +34,13 @@ $ git clone git://github.com/NixOS/nixpkgs.git
</screen> </screen>
This will check out the latest NixOS sources to This will check out the latest NixOS sources to
<filename><replaceable>/my/sources</replaceable>/nixpkgs/nixos</filename> and <filename><replaceable>/my/sources</replaceable>/nixpkgs/nixos</filename>
the Nixpkgs sources to and the Nixpkgs sources to
<filename><replaceable>/my/sources</replaceable>/nixpkgs</filename>. <filename><replaceable>/my/sources</replaceable>/nixpkgs</filename>.
If you want to rebuild your system using your (modified) sources, you (The NixOS source tree lives in a subdirectory of the Nixpkgs
need to tell <command>nixos-rebuild</command> about them using the repository.) If you want to rebuild your system using your (modified)
<option>-I</option> flag: sources, you need to tell <command>nixos-rebuild</command> about them
using the <option>-I</option> flag:
<screen> <screen>
$ nixos-rebuild switch -I nixpkgs=<replaceable>/my/sources</replaceable>/nixpkgs $ nixos-rebuild switch -I nixpkgs=<replaceable>/my/sources</replaceable>/nixpkgs
@ -47,24 +48,26 @@ $ nixos-rebuild switch -I nixpkgs=<replaceable>/my/sources</replaceable>/nixpkgs
</para> </para>
<para><command>nixos-rebuild</command> affects only the system profile. <para>If you want <command>nix-env</command> to use the expressions in
To install packages to your user profile from expressions in <replaceable>/my/sources</replaceable>, use <command>nix-env -f
<replaceable>/my/sources</replaceable>, use <replaceable>/my/sources</replaceable>/nixpkgs</command>, or change
<command>nix-env -f <replaceable>/my/sources</replaceable>/nixpkgs</command>, the default by adding a symlink in
or change the default by replacing the symlink in
<filename>~/.nix-defexpr</filename>: <filename>~/.nix-defexpr</filename>:
<screen> <screen>
$ rm -f ~/.nix-defexpr/channels
$ ln -s <replaceable>/my/sources</replaceable>/nixpkgs ~/.nix-defexpr/nixpkgs $ ln -s <replaceable>/my/sources</replaceable>/nixpkgs ~/.nix-defexpr/nixpkgs
</screen> </screen>
</para> You may want to delete the symlink
<filename>~/.nix-defexpr/channels_root</filename> to prevent roots
NixOS channel from clashing with your own tree.</para>
<!-- FIXME: not sure what this means.
<para>You should not pass the base directory <para>You should not pass the base directory
<filename><replaceable>/my/sources</replaceable></filename> <filename><replaceable>/my/sources</replaceable></filename>
to <command>nix-env</command>, as it will break after interpreting expressions to <command>nix-env</command>, as it will break after interpreting expressions
in <filename>nixos/</filename> as packages.</para> in <filename>nixos/</filename> as packages.</para>
-->
</section> </section>