Skip to content

Commit

Permalink
Merge branch 'NixOS:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Dragos authored Jul 30, 2022
2 parents 97bc102 + 4f3df4b commit 4bc6ba5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pills/16-nixpkgs-parameters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
<section>
<title>The config parameter</title>
<para>
I'm sure on the wiki or other manuals you've read about <filename>~/.nixpkgs/config.nix</filename> and I'm sure you've wondered whether that's hardcoded in nix. It's not, it's in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix#L45">nixpkgs</link>.
I'm sure on the wiki or other manuals you've read about <filename>~/.config/nixpkgs/config.nix</filename> (previously <filename>~/.nixpkgs/config.nix</filename>) and I'm sure you've wondered whether that's hardcoded in nix. It's not, it's in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/32c523914fdb8bf9cc7912b1eba023a8daaae2e8/pkgs/top-level/impure.nix#L28">nixpkgs</link>.
</para>
<para>
The <filename>all-packages.nix</filename> expression accepts the <literal>config</literal> parameter. If it's <literal>null</literal>, then it reads the <varname>NIXPKGS_CONFIG</varname> environment variable. If not specified, <literal>nixpkgs</literal> will peek <filename>$HOME/.nixpkgs/config.nix</filename>.
The <filename>all-packages.nix</filename> expression accepts the <literal>config</literal> parameter. If it's <literal>null</literal>, then it reads the <varname>NIXPKGS_CONFIG</varname> environment variable. If not specified, <literal>nixpkgs</literal> will peek <filename>$HOME/.config/nixpkgs/config.nix</filename>.
</para>
<para>
After determining <filename>config.nix</filename>, it will be imported as nix expression, and that will be the value of <literal>config</literal> (in case it hasn't been passed as parameter to import <literal>&lt;nixpkgs&gt;</literal>).
Expand Down
8 changes: 4 additions & 4 deletions pills/17-nixpkgs-overriding-packages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
The fixed point with lazy evaluation is crippling but about necessary in a language like Nix. It lets us achieve something similar to what we'd do imperatively.
</para>
<para>
Follows the definition of fixed point in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/trivial.nix#L21">nixpkgs</link>:
Follows the definition of fixed point in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/f224a4f1b32b3e813783d22de54e231cd8ea2448/lib/fixed-points.nix#L19">nixpkgs</link>:
</para>
<screen><xi:include href="./17/fix-function.txt" parse="text" /></screen>
<para>
Expand Down Expand Up @@ -108,12 +108,12 @@
</para>
</section>
<section>
<title>The ~/.nixpkgs/config.nix file</title>
<title>The ~/.config/nixpkgs/config.nix file</title>
<para>
In the previous pill we already talked about this file. The above <filename>config.nix</filename> that we just wrote could be the content of <filename>~/.nixpkgs/config.nix</filename>.
In the previous pill we already talked about this file. The above <filename>config.nix</filename> that we just wrote could be the content of <filename>~/.config/nixpkgs/config.nix</filename> (or the deprecated location <filename>~/.nixpkgs/config.nix</filename>).
</para>
<para>
Instead of passing it explicitly whenever we import <literal>nixpkgs</literal>, it will be automatically <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix#L54">imported by nixpkgs</link>.
Instead of passing it explicitly whenever we import <literal>nixpkgs</literal>, it will be automatically <link xlink:href="https://github.com/NixOS/nixpkgs/blob/32c523914fdb8bf9cc7912b1eba023a8daaae2e8/pkgs/top-level/impure.nix#L28">imported by nixpkgs</link>.
</para>
</section>
<section>
Expand Down

0 comments on commit 4bc6ba5

Please sign in to comment.