1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 15:09:46 +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:
Robert Helgesson 2020-04-18 10:54:40 +02:00
parent e5325c2274
commit 687395ebda
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -110,22 +110,12 @@ function doBuildAttr() {
extraArgs=("${extraArgs[@]}" "--show-trace") extraArgs=("${extraArgs[@]}" "--show-trace")
fi 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 \ nix-build \
"<home-manager/home-manager/home-manager.nix>" \ "<home-manager/home-manager/home-manager.nix>" \
"${extraArgs[@]}" \ "${extraArgs[@]}" \
"${PASSTHROUGH_OPTS[@]}" \ "${PASSTHROUGH_OPTS[@]}" \
--argstr confPath "$HOME_MANAGER_CONFIG" \ --argstr confPath "$HOME_MANAGER_CONFIG" \
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE" --argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
fi
} }
# Presents news to the user. Takes as argument the path to a "news # Presents news to the user. Takes as argument the path to a "news
@ -191,13 +181,8 @@ function doBuild() {
local exitCode local exitCode
if [[ -v USE_NIX2_COMMAND ]]; then
doBuildAttr activationPackage \
&& exitCode=0 || exitCode=1
else
doBuildAttr --attr activationPackage \ doBuildAttr --attr activationPackage \
&& exitCode=0 || exitCode=1 && exitCode=0 || exitCode=1
fi
presentNews "$newsInfo" presentNews "$newsInfo"
@ -219,17 +204,10 @@ function doSwitch() {
# before activation completes. # before activation completes.
generation="$WORK_DIR/generation" generation="$WORK_DIR/generation"
if [[ -v USE_NIX2_COMMAND ]]; then
doBuildAttr \
--out-link "$generation" \
activationPackage \
&& "$generation/activate" || exitCode=1
else
doBuildAttr \ doBuildAttr \
--out-link "$generation" \ --out-link "$generation" \
--attr activationPackage \ --attr activationPackage \
&& "$generation/activate" || exitCode=1 && "$generation/activate" || exitCode=1
fi
presentNews "$newsInfo" presentNews "$newsInfo"
@ -329,14 +307,6 @@ function buildNews() {
local output local output
output="$WORK_DIR/news-info.sh" 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 \ doBuildAttr \
--out-link "$output" \ --out-link "$output" \
--no-build-output \ --no-build-output \
@ -345,7 +315,6 @@ function buildNews() {
--argstr newsReadIdsFile "$(newsReadIdsFile)" \ --argstr newsReadIdsFile "$(newsReadIdsFile)" \
--attr newsInfo \ --attr newsInfo \
> /dev/null > /dev/null
fi
echo "$output" echo "$output"
} }
@ -498,9 +467,6 @@ while [[ $# -gt 0 ]]; do
build|instantiate|edit|expire-generations|generations|help|news|packages|remove-generations|switch|uninstall) build|instantiate|edit|expire-generations|generations|help|news|packages|remove-generations|switch|uninstall)
COMMAND="$opt" COMMAND="$opt"
;; ;;
-2)
USE_NIX2_COMMAND=1
;;
-A) -A)
HOME_MANAGER_CONFIG_ATTRIBUTE="$1" HOME_MANAGER_CONFIG_ATTRIBUTE="$1"
shift shift