From 67391395ef5d2103327f35fc9182ff56754842c4 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 21 May 2017 23:54:38 +0200 Subject: [PATCH] home-manager: use `NIX_PATH` to locate modules This removes the old argument based method that Home Manager used to find its modules by a `NIX_PATH` based method. Specifically, this adds a `home-manager` Nix path prefix that can be overridden much like with the `nixpkgs` path prefix. --- home-manager/default.nix | 4 ++-- home-manager/home-manager | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/home-manager/default.nix b/home-manager/default.nix index f2b994954..79f3e6d09 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -3,10 +3,10 @@ let homeManagerExpr = pkgs.writeText "home-manager.nix" '' - { pkgs ? import {}, confPath, modulesPath }: + { pkgs ? import {}, confPath }: let - env = import modulesPath { + env = import { configuration = import confPath; pkgs = pkgs; }; diff --git a/home-manager/home-manager b/home-manager/home-manager index f8fe71317..e5111f512 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -41,6 +41,8 @@ function doBuild() { exit 1 fi + export NIX_PATH="$NIX_PATH${NIX_PATH:+:}home-manager=@MODULES_PATH@" + local extraArgs extraArgs="" @@ -54,7 +56,6 @@ function doBuild() { nix-build $extraArgs \ "@HOME_MANAGER_EXPR_PATH@" \ - --argstr modulesPath "@MODULES_PATH@" \ --argstr confPath "$confFile" \ -A activation-script \ -o "$output"