2.7 KiB
Standalone installation
-
Make sure you have a working Nix installation. Specifically, make sure that your user is able to build and install Nix packages. For example, you should be able to successfully run a command like
nix-instantiate '<nixpkgs>' -A hellowithout having to switch to the root user. For a multi-user install of Nix this means that your user must be covered by theallowed-usersNix option. On NixOS you can control this option using thenix.settings.allowed-userssystem option. -
Add the appropriate Home Manager channel. If you are following Nixpkgs master or an unstable channel you can run
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager $ nix-channel --updateand if you follow a Nixpkgs version 25.05 channel you can run
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz home-manager $ nix-channel --update -
Run the Home Manager installation command and create the first Home Manager generation:
$ nix-shell '<home-manager>' -A installOnce finished, Home Manager should be active and available in your user environment.
-
If you do not plan on having Home Manager manage your shell configuration then you must source the
$HOME/.nix-profile/etc/profile.d/hm-session-vars.shfile in your shell configuration. Alternatively source
/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.shwhen managing home configuration together with system configuration.
This file can be sourced directly by POSIX.2-like shells such as Bash or Z shell. Fish users can use utilities such as foreign-env or babelfish.
For example, if you use Bash then add
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"to your
~/.profilefile.
If instead of using channels you want to run Home Manager from a Git checkout of the repository then you can use the home-manager.path option to specify the absolute path to the repository.
Once installed you can see Using Home Manager for a more detailed description of Home Manager and how to use it.