docs: update session-vars info about fish shell

The docs implied that fish was not really supported, but if fish is
managed by Home Manager, the generated config does use fenv to source
the session-vars file. Update the installation instructions and FAQ to
mention that fish does work, and mention fenv in the README.
main
Romanos Skiadas 3 years ago committed by Robert Helgesson
parent bd747c5a53
commit 2952168ed5
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
  1. 9
      README.md
  2. 10
      docs/faq.adoc
  3. 6
      docs/installation.adoc

@ -107,9 +107,8 @@ Currently the easiest way to install Home Manager is as follows:
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
```
file in your shell configuration. Unfortunately, in this specific
case we currently only support POSIX.2-like shells such as
[Bash][] or [Z shell][].
file in your shell configuration. This file can be sourced
directly by POSIX.2-like shells such as [Bash][] or [Z shell][].
For example, if you use Bash then add
@ -124,7 +123,9 @@ Currently the easiest way to install Home Manager is as follows:
. "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
```
to your `~/.profile` file.
to your `~/.profile` file. For fish shell, it is possible to use
[foreign-env](https://github.com/oh-my-fish/plugin-foreign-env) to
source the file.
If instead of using channels you want to run Home Manager from a Git
checkout of the repository then you can use the

@ -43,15 +43,21 @@ The solution is typically to uninstall the package from the environment using `n
You could also opt to unistall _all_ of the packages from your profile with `nix-env --uninstall '*'`.
=== Why are the session variables not set?
:foreign-env: https://github.com/oh-my-fish/plugin-foreign-env
Home Manager is only able to set session variables automatically if it manages your Bash or Z shell configuration. If you don't want to let Home Manager manage your shell then you will have to manually source the `~/.nix-profile/etc/profile.d/hm-session-vars.sh` file in an appropriate way. In Bash and Z shell this can be done by adding
Home Manager is only able to set session variables automatically if it manages your Bash, Z shell, or fish shell configuration. If you don't want to let Home Manager manage your shell then you will have to manually source the `~/.nix-profile/etc/profile.d/hm-session-vars.sh` file in an appropriate way. In Bash and Z shell this can be done by adding
[source,bash]
----
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
----
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells.
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells. For fish shell, it is possible to source it using {foreign-env}[the foreign-env plugin]
[source,bash]
----
fenv source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" > /dev/null
----
=== How to set up a configuration for multiple users/machines?
:post-your-homenix: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/

@ -86,7 +86,7 @@ file in your shell configuration. Alternatively source
+
when managing home configuration together with system configuration.
+
Unfortunately, we currently only support POSIX.2-like shells such as
This file can be sourced directly by POSIX.2-like shells such as
https://www.gnu.org/software/bash/[Bash] or
http://zsh.sourceforge.net/[Z shell].
+
@ -97,7 +97,9 @@ For example, if you use Bash then add
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
----
+
to your `~/.profile` file.
to your `~/.profile` file. For fish shell, it is possible to use
https://github.com/oh-my-fish/plugin-foreign-env[foreign-env] to
source the file.
If instead of using channels you want to run Home Manager from a Git
checkout of the repository then you can use the

Loading…
Cancel
Save