Direnv: Difference between revisions

Nix support stuff
Pigs (talk | contribs)
m move nixos content under nixos section
 
(One intermediate revision by one other user not shown)
Line 28: Line 28:


While Direnv has [https://github.com/direnv/direnv/wiki/Nix full support for Nix] development environments, third-party developers have improved upon Direnv's default implementation of the special <code>use_nix</code> keyword, resulting in the development of [https://github.com/nix-community/nix-direnv <code>nix-direnv</code>] and [https://github.com/nix-community/lorri <code>lorri</code>].
While Direnv has [https://github.com/direnv/direnv/wiki/Nix full support for Nix] development environments, third-party developers have improved upon Direnv's default implementation of the special <code>use_nix</code> keyword, resulting in the development of [https://github.com/nix-community/nix-direnv <code>nix-direnv</code>] and [https://github.com/nix-community/lorri <code>lorri</code>].
The NixOS module uses <code>nix-direnv</code> by default when Direnv is enabled, but this can be overriden with the {{nixos:option|programs.direnv.nix-direnv.package}} option.


== Configuring on NixOS ==
== Configuring on NixOS ==


There is a [[Overview_of_the_NixOS_Linux_distribution|NixOS]] Module for Direnv (and <code>nix-direnv</code>) which automatically sets everything up in a given NixOS machine. The following line of code is everything that's necessary for NixOS to automatically install and hook Direnv to the available shells in the system:
There is a [[Overview_of_the_NixOS_Linux_distribution|NixOS]] Module for Direnv (and <code>nix-direnv</code>) which automatically sets everything up in a given NixOS machine. The following line of code is everything that's necessary for NixOS to automatically install and hook Direnv to the available [[Command Shell|shells]] in the system:


{{file|configuration.nix|nix|<nowiki>
{{file|configuration.nix|nix|<nowiki>
Line 40: Line 38:
}
}
</nowiki>}}
</nowiki>}}
{{Evaluate}}
{{Evaluate}}
For a full list of Direnv module options, see {{nixos:option|programs.direnv}}.
The NixOS module uses <code>nix-direnv</code> by default when Direnv is enabled. This behavior can be overridden by setting the {{nixos:option|programs.direnv.nix-direnv.enable}} option.


== Troubleshooting ==
== Troubleshooting ==
Line 54: Line 57:
* [https://direnv.net/ direnv.net].
* [https://direnv.net/ direnv.net].
* The [https://github.com/direnv/direnv/wiki/Nix Direnv Wiki].
* The [https://github.com/direnv/direnv/wiki/Nix Direnv Wiki].
[[Category:Development]]
[[Category:Applications]]