mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
home-manager: remove unsupported -2
option
This option used to make the `home-manager` command use the `nix` tool from Nix 2. Unfortunately the `nix` tool is a bit experimental and it is best to await its stabilization before supporting it in Home Manager.
This commit is contained in:
parent
e5325c2274
commit
687395ebda
1 changed files with 20 additions and 54 deletions
|
@ -110,22 +110,12 @@ function doBuildAttr() {
|
|||
extraArgs=("${extraArgs[@]}" "--show-trace")
|
||||
fi
|
||||
|
||||
# shellcheck disable=2086
|
||||
if [[ -v USE_NIX2_COMMAND ]]; then
|
||||
nix build \
|
||||
-f "<home-manager/home-manager/home-manager.nix>" \
|
||||
"${extraArgs[@]}" \
|
||||
"${PASSTHROUGH_OPTS[@]}" \
|
||||
--argstr confPath "$HOME_MANAGER_CONFIG" \
|
||||
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
|
||||
else
|
||||
nix-build \
|
||||
"<home-manager/home-manager/home-manager.nix>" \
|
||||
"${extraArgs[@]}" \
|
||||
"${PASSTHROUGH_OPTS[@]}" \
|
||||
--argstr confPath "$HOME_MANAGER_CONFIG" \
|
||||
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
|
||||
fi
|
||||
}
|
||||
|
||||
# Presents news to the user. Takes as argument the path to a "news
|
||||
|
@ -191,13 +181,8 @@ function doBuild() {
|
|||
|
||||
local exitCode
|
||||
|
||||
if [[ -v USE_NIX2_COMMAND ]]; then
|
||||
doBuildAttr activationPackage \
|
||||
&& exitCode=0 || exitCode=1
|
||||
else
|
||||
doBuildAttr --attr activationPackage \
|
||||
&& exitCode=0 || exitCode=1
|
||||
fi
|
||||
|
||||
presentNews "$newsInfo"
|
||||
|
||||
|
@ -219,17 +204,10 @@ function doSwitch() {
|
|||
# before activation completes.
|
||||
generation="$WORK_DIR/generation"
|
||||
|
||||
if [[ -v USE_NIX2_COMMAND ]]; then
|
||||
doBuildAttr \
|
||||
--out-link "$generation" \
|
||||
activationPackage \
|
||||
&& "$generation/activate" || exitCode=1
|
||||
else
|
||||
doBuildAttr \
|
||||
--out-link "$generation" \
|
||||
--attr activationPackage \
|
||||
&& "$generation/activate" || exitCode=1
|
||||
fi
|
||||
|
||||
presentNews "$newsInfo"
|
||||
|
||||
|
@ -329,14 +307,6 @@ function buildNews() {
|
|||
local output
|
||||
output="$WORK_DIR/news-info.sh"
|
||||
|
||||
if [[ -v USE_NIX2_COMMAND ]]; then
|
||||
doBuildAttr \
|
||||
--out-link "$output" \
|
||||
--quiet \
|
||||
--arg check false \
|
||||
--argstr newsReadIdsFile "$(newsReadIdsFile)" \
|
||||
newsInfo
|
||||
else
|
||||
doBuildAttr \
|
||||
--out-link "$output" \
|
||||
--no-build-output \
|
||||
|
@ -345,7 +315,6 @@ function buildNews() {
|
|||
--argstr newsReadIdsFile "$(newsReadIdsFile)" \
|
||||
--attr newsInfo \
|
||||
> /dev/null
|
||||
fi
|
||||
|
||||
echo "$output"
|
||||
}
|
||||
|
@ -498,9 +467,6 @@ while [[ $# -gt 0 ]]; do
|
|||
build|instantiate|edit|expire-generations|generations|help|news|packages|remove-generations|switch|uninstall)
|
||||
COMMAND="$opt"
|
||||
;;
|
||||
-2)
|
||||
USE_NIX2_COMMAND=1
|
||||
;;
|
||||
-A)
|
||||
HOME_MANAGER_CONFIG_ATTRIBUTE="$1"
|
||||
shift
|
||||
|
|
Loading…
Reference in a new issue