mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 02:39:48 +01:00
home-manager: add command line option -I
This options is passed on to nix-build and allows, for example, building a user environment using a custom Nixpkgs.
This commit is contained in:
parent
fa73a7f916
commit
ed9464258a
1 changed files with 13 additions and 2 deletions
|
@ -34,7 +34,13 @@ function doBuild() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
nix-build --show-trace \
|
||||
local extraArgs
|
||||
|
||||
for p in "${EXTRA_NIX_PATH[@]}"; do
|
||||
extraArgs="$extraArgs -I $p"
|
||||
done
|
||||
|
||||
nix-build --show-trace $extraArgs \
|
||||
"@HOME_MANAGER_EXPR_PATH@" \
|
||||
--argstr modulesPath "@MODULES_PATH@" \
|
||||
--argstr confPath "$confFile" \
|
||||
|
@ -76,6 +82,7 @@ function doHelp() {
|
|||
echo "Options"
|
||||
echo
|
||||
echo " -f FILE The home configuration file. Default is ~/.nixpkgs/home.nix"
|
||||
echo " -I PATH Add a path to the Nix expression search path."
|
||||
echo " -v Verbose output"
|
||||
echo " -n Do a dry run, only prints what actions would be taken"
|
||||
echo " -h Print this help"
|
||||
|
@ -89,12 +96,16 @@ function doHelp() {
|
|||
}
|
||||
|
||||
CONFIG_FILE="$HOME/.nixpkgs/home.nix"
|
||||
EXTRA_NIX_PATH=()
|
||||
|
||||
while getopts f:vnh opt; do
|
||||
while getopts f:I:vnh opt; do
|
||||
case $opt in
|
||||
f)
|
||||
CONFIG_FILE=$OPTARG
|
||||
;;
|
||||
I)
|
||||
EXTRA_NIX_PATH+=("$OPTARG")
|
||||
;;
|
||||
v)
|
||||
export VERBOSE=1
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue