mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
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.
This commit is contained in:
parent
ff65781b84
commit
67391395ef
2 changed files with 4 additions and 3 deletions
|
@ -3,10 +3,10 @@
|
|||
let
|
||||
|
||||
homeManagerExpr = pkgs.writeText "home-manager.nix" ''
|
||||
{ pkgs ? import <nixpkgs> {}, confPath, modulesPath }:
|
||||
{ pkgs ? import <nixpkgs> {}, confPath }:
|
||||
|
||||
let
|
||||
env = import modulesPath {
|
||||
env = import <home-manager> {
|
||||
configuration = import confPath;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue