Direnv: Difference between revisions
Add note on Direnv being a personalized file to encourage projects to stop committing files that mess with contributor workflows. |
m I documented how to determine whether a configuration file is managed or not, as it may be a cause of an unhooked direnv. |
||
| Line 62: | Line 62: | ||
Depending on the shell you are using, you need to add a line in your shell configuration file. See the [https://direnv.net/docs/hook.html ''Hook'' section of the Direnv Documentation] for more information. | Depending on the shell you are using, you need to add a line in your shell configuration file. See the [https://direnv.net/docs/hook.html ''Hook'' section of the Direnv Documentation] for more information. | ||
Setting Direnv up using the NixOS module should do this by default. | Setting Direnv up using the NixOS module should do this by default. If direnv is not hooked, after having setup the NixOS module as described above please ensure, that you have no unmanaged shell configuration files, e.g. <code>.bashrc</code>, <code>.zshrc</code>, <code>.profile</code>, etc.. To determine whether a configuration file is unmanged, use the ''list directory contents'' command with the ''long listing format'' flag as shown below; if the file points to the nix store, it is managed, otherwise, it is unmanaged. If the appropriate configuration files are managed, and direnv is still not hooked, please ensure that your shell session has been reloaded after your latest rebuild.<syntaxhighlight lang="shell-session"> | ||
# Supposing managed .bashrc | |||
$ ls -l ~/.bashrc | |||
lrwxrwxrwx 1 ghb users 70 sep 1 11:41 /home/user/.bashrc -> /nix/store/wfzbf11b0mff8d1isp3lx5pr4ainbc7p-home-manager-files/.bashrc | |||
</syntaxhighlight> | |||
== See Also == | == See Also == | ||