1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

readme: update installation instructions

Also clean up usage section slightly.
This commit is contained in:
Robert Helgesson 2017-10-23 14:01:38 +02:00
parent bf3a8c6383
commit df84c466c1
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86

View file

@ -46,50 +46,62 @@ Currently the easiest way to install Home Manager is as follows:
since Home Manager uses these directories to manage your profile since Home Manager uses these directories to manage your profile
generations. On NixOS these should already be available. generations. On NixOS these should already be available.
2. Clone the Home Manager repository into the `~/.config/nixpkgs` 2. Assign a temporary variable holding the URL to the appropriate
directory: archive. Typically this is
```console ```console
$ git clone -b master https://github.com/rycee/home-manager ~/.config/nixpkgs/home-manager $ HM_PATH=https://github.com/rycee/home-manager/archive/master.tar.gz
``` ```
or or
```console ```console
$ git clone -b release-17.09 https://github.com/rycee/home-manager ~/.config/nixpkgs/home-manager $ HM_PATH=https://github.com/rycee/home-manager/archive/release-17.09.tar.gz
``` ```
depending on whether you are tracking Nixpkgs unstable or version depending on whether you follow Nixpkgs unstable or version 17.09.
17.09.
3. Add Home Manager to your user's Nixpkgs, for example by symlinking the 2. Create an initial Home Manager configuration file:
overlay to `~/.config/nixpkgs/overlays`:
```console ```console
$ ln -s ~/.config/nixpkgs/home-manager/overlay.nix ~/.config/nixpkgs/overlays/home-manager.nix $ cat > ~/.config/nixpkgs/home.nix <<EOF
{
programs.home-manager.enable = true;
programs.home-manager.path = $HM_PATH;
}
EOF
``` ```
4. Install the `home-manager` package: 3. Create the first Home Manager generation:
```console ```console
$ nix-env -f '<nixpkgs>' -iA home-manager $ nix-shell $HM_PATH -A install --run 'home-manager switch'
installing home-manager
``` ```
Home Manager should now be active and available in your user
environment.
Note, because the `HM_PATH` variable above points to the live Home
Manager repository you will automatically get updates whenever you
build a new generation. If you dislike automatic updates then perform
a Git clone of the desired branch and set `programs.home-manager.path`
to the absolute path of your clone.
Usage Usage
----- -----
The `home-manager` package installs a tool that is conveniently called Home Manager is typically managed through the `home-manager` tool.
`home-manager`. This tool can apply configurations to your home This tool can, for example, apply configurations to your home
directory, list user packages installed by the tool, and list the directory, list user packages installed by the tool, and list the
configuration generations. configuration generations.
As an example, let us set up a very simple configuration that installs As an example, let us expand the initial configuration file from the
the htop and fortune packages, installs Emacs with a few extra installation above to install the htop and fortune packages, install
packages enabled, installs Firefox with Adobe Flash enabled, and Emacs with a few extra packages enabled, install Firefox with Adobe
enables the user gpg-agent service. Flash enabled, and enable the user gpg-agent service.
First create a file `~/.config/nixpkgs/home.nix` containing To satisfy the above setup we should elaborate the
`~/.config/nixpkgs/home.nix` file as follows:
```nix ```nix
{ pkgs, ... }: { pkgs, ... }:
@ -118,6 +130,11 @@ First create a file `~/.config/nixpkgs/home.nix` containing
defaultCacheTtl = 1800; defaultCacheTtl = 1800;
enableSshSupport = true; enableSshSupport = true;
}; };
programs.home-manager = {
enable = true;
path = "…";
};
} }
``` ```
@ -136,8 +153,8 @@ $ home-manager build
which will create a `result` link to a directory containing an which will create a `result` link to a directory containing an
activation script and the generated home directory files. activation script and the generated home directory files.
To see available configuration options with descriptions To see available configuration options with descriptions and usage
and usage examples run examples run
```console ```console
$ man home-configuration.nix $ man home-configuration.nix