mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +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
|
let
|
||||||
|
|
||||||
homeManagerExpr = pkgs.writeText "home-manager.nix" ''
|
homeManagerExpr = pkgs.writeText "home-manager.nix" ''
|
||||||
{ pkgs ? import <nixpkgs> {}, confPath, modulesPath }:
|
{ pkgs ? import <nixpkgs> {}, confPath }:
|
||||||
|
|
||||||
let
|
let
|
||||||
env = import modulesPath {
|
env = import <home-manager> {
|
||||||
configuration = import confPath;
|
configuration = import confPath;
|
||||||
pkgs = pkgs;
|
pkgs = pkgs;
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,6 +41,8 @@ function doBuild() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export NIX_PATH="$NIX_PATH${NIX_PATH:+:}home-manager=@MODULES_PATH@"
|
||||||
|
|
||||||
local extraArgs
|
local extraArgs
|
||||||
extraArgs=""
|
extraArgs=""
|
||||||
|
|
||||||
|
@ -54,7 +56,6 @@ function doBuild() {
|
||||||
|
|
||||||
nix-build $extraArgs \
|
nix-build $extraArgs \
|
||||||
"@HOME_MANAGER_EXPR_PATH@" \
|
"@HOME_MANAGER_EXPR_PATH@" \
|
||||||
--argstr modulesPath "@MODULES_PATH@" \
|
|
||||||
--argstr confPath "$confFile" \
|
--argstr confPath "$confFile" \
|
||||||
-A activation-script \
|
-A activation-script \
|
||||||
-o "$output"
|
-o "$output"
|
||||||
|
|
Loading…
Reference in a new issue