1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-04-15 00:36:44 +00:00

activation-checks: don't fail before showing error message

This commit is contained in:
Daiderd Jordan 2017-07-24 19:29:31 +02:00
parent ed7da178fe
commit 4281f777d7
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -32,7 +32,7 @@ let
'';
nixPath = ''
darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin-config>')
darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin-config>') || true
if ! test -e "$darwinConfig"; then
echo "error: Changed <darwin-config> but target does not exist, aborting activation" >&2
echo "Move you configuration.nix or set NIX_PATH:" >&2
@ -42,7 +42,7 @@ let
exit 2
fi
darwinPath=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin>')
darwinPath=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin>') || true
if ! test -e "$darwinPath"; then
echo "error: Changed <darwin> but target does not exist, aborting activation" >&2
echo "Add the darwin repo as a channel or set NIX_PATH:" >&2
@ -56,7 +56,7 @@ let
exit 2
fi
nixpkgsPath=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<nixpkgs>')
nixpkgsPath=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<nixpkgs>') || true
if ! test -e "$nixpkgsPath"; then
echo "error: Changed <nixpkgs> but target does not exist, aborting activation" >&2
echo "Add a nixpkgs channel or set NIX_PATH:" >&2