3
0
Fork 0
forked from mirrors/nixpkgs

Add user channels to the default nix path

This commit is contained in:
Graham Christensen 2018-04-02 15:02:43 -04:00
parent 2f0e2376ac
commit 8ab8d9cb74
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 16 additions and 3 deletions

View file

@ -20,10 +20,21 @@ has the following highlights: </para>
<itemizedlist>
<listitem>
<para>
TODO
User channels are now in the default <literal>NIX_PATH</literal>,
allowing users to use their personal <command>nix-channel</command>
defined channels in <command>nix-build</command> and
<command>nix-shell</command> commands, as well as in imports like
<code>import &lt;mychannel&gt;</code>.
</para>
<para>For example</para>
<programlisting>
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgsunstable
$ nix-channel --update
$ nix-build '&lt;nixpkgsunstable&gt;' -A gitFull
$ nix run -f '&lt;nixpkgsunstable&gt;' gitFull
$ nix-instantiate -E '(import &lt;nixpkgsunstable&gt; {}).gitFull'
</programlisting>
</listitem>
</itemizedlist>
</section>

View file

@ -338,7 +338,9 @@ in
nixPath = mkOption {
type = types.listOf types.str;
default =
[ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs"
[
"$HOME/.nix-defexpr/channels"
"nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs"
"nixos-config=/etc/nixos/configuration.nix"
"/nix/var/nix/profiles/per-user/root/channels"
];