Return a derivation fn in main nix expression

This simplifies installing by (re-)enabling the standard practice
of using the main expression as a function returning the package derivation.

Convert the src dir path to a string to avoid needlessly copying the whole
dir to the nix store.
This commit is contained in:
Cornelius Mika 2017-11-15 20:33:30 +01:00
parent 4fce730326
commit 85b4c430eb
2 changed files with 4 additions and 12 deletions

View file

@ -83,7 +83,7 @@ Currently the easiest way to install Home Manager is as follows:
4. Create the first Home Manager generation:
```console
$ nix-shell $HM_PATH -A install --run 'home-manager switch'
$ $(nix-build $HM_PATH --no-out-link)/bin/home-manager switch
```
Home Manager should now be active and available in your user

View file

@ -1,14 +1,6 @@
{ pkgs ? import <nixpkgs> {} }:
rec {
home-manager = import ./home-manager {
inherit pkgs;
path = ./.;
};
install =
pkgs.runCommand
"home-manager-install"
{ propagatedBuildInputs = [ home-manager ]; }
"";
import ./home-manager {
inherit pkgs;
path = toString ./.;
}