From 6e67bb7ae611ee37bd94638f90a3f001467a7ba3 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 15 Sep 2018 13:27:21 +0200 Subject: [PATCH] doc: add installation instructions to manual Also minor cleanups in README. --- README.md | 11 ++-- doc/installation.xml | 149 +++++++++++++++++++++++++++++++++++++++++++ doc/manual.xml | 1 + 3 files changed, 156 insertions(+), 5 deletions(-) create mode 100644 doc/installation.xml diff --git a/README.md b/README.md index 65fd09382..a599ce3c2 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,11 @@ Currently the easiest way to install Home Manager is as follows: Also 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 '' -A hello`. For a - multi-user install of Nix this means that your user must be - covered by the [`allowed-users`][nixAllowedUsers] Nix option. On - NixOS you can control this option using the + command like `nix-instantiate '' -A hello` without having + to switch to the root user. For a multi-user install of Nix this + means that your user must be covered by the + [`allowed-users`][nixAllowedUsers] Nix option. On NixOS you can + control this option using the [`nix.allowedUsers`][nixosAllowedUsers] system option. 2. Add the appropriate Home Manager channel. Typically this is @@ -83,7 +84,7 @@ Currently the easiest way to install Home Manager is as follows: configuration then you must source the ``` - "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" + $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh ``` file in your shell configuration. Unfortunately, we currently only diff --git a/doc/installation.xml b/doc/installation.xml new file mode 100644 index 000000000..532947554 --- /dev/null +++ b/doc/installation.xml @@ -0,0 +1,149 @@ + + Installing Home Manager + + Home Manager can be used in three primary ways: + + + + Using the standalone home-manager tool. For platforms + other than NixOS and Darwin, this is the only available choice. It is also + recommended for people on NixOS or Darwin that want to manage their home + directory independent of the system as a whole. See + for instructions on how to + perform this installation. + + + + + As a module within a NixOS system configuration. This allows the user + profiles to be built together with the system when running + nixos-rebuild. See + for a description of this + setup. + + + + + As a module within a + nix-darwin + system configuration. This allows the user profiles to be built together + with the system when running darwin-rebuild. See + for a description of this + setup. + + + + +
+ Standalone installation + + + + + Make sure you have a working Nix installation. If you are not using NixOS + then it may be necessary to run + + +$ mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER + + + since Home Manager uses these directories to manage your profile + generations. On NixOS these should already be available. + + + Also 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 hello without + having to switch to the root user. For a multi-user install of Nix this + means that your user must be covered by the + allowed-users + Nix option. On NixOS you can control this option using the + nix.allowedUsers + system option. + + + + + Add the Home Manager channel that you wish to follow. This is done by + running + + +$ nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager +$ nix-channel --update + + + if you are following Nixpkgs master or an unstable channel and + + +$ nix-channel --add https://github.com/rycee/home-manager/archive/release-18.09.tar.gz home-manager +$ nix-channel --update + + + if you follow a Nixpkgs version 18.09 channel. + + + + + Run the Home Manager installation command and create the first Home + Manager generation: + + +$ nix-shell '<home-manager>' -A install + + + Once 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.sh + + + file in your shell configuration. Unfortunately, we currently only support + POSIX.2-like shells such as + Bash or + Z shell. + + + For example, if you use Bash then add + + +. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" + + + to your ~/.profile file. + + + + + + If instead of using channels you want to run Home Manager from a Git + checkout of the repository then you can use the + programs.home-manager.path option to specify the absolute + path to the repository. + +
+
+ NixOS module + + + To be done. + +
+
+ nix-darwin module + + + To be done. + +
+
diff --git a/doc/manual.xml b/doc/manual.xml index f076f8338..f0431092b 100644 --- a/doc/manual.xml +++ b/doc/manual.xml @@ -24,6 +24,7 @@ + Configuration Options