1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

checks: update and improve darwin-config message

Now that environment.darwinConfig exists it's a better choice otherwise
multiple NIX_PATH entries need to be added.
This commit is contained in:
Daiderd Jordan 2018-08-26 14:47:40 +02:00
parent e57ac2ee71
commit 7750896cc7
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -84,9 +84,13 @@ let
darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin-config>' || echo '$HOME/.nixpkgs/darwin-configuration.nix') || true
if ! test -e "$darwinConfig"; then
echo "error: Changed <darwin-config> but target does not exist, aborting activation" >&2
echo "Create $darwinConfig or set nix.nixPath:" >&2
echo "Create $darwinConfig or set environment.darwinConfig:" >&2
echo >&2
echo " environment.darwinConfig = \"$(nix-instantiate --eval -E '<darwin-config>' 2> /dev/null || echo '***')\";" >&2
echo >&2
echo "And rebuild using (only required once)" >&2
echo "$ darwin-rebuild switch -I \"darwin-config=$(nix-instantiate --eval -E '<darwin-config>' 2> /dev/null || echo '***')\"" >&2
echo >&2
echo " nix.nixPath = [ \"darwin-config=$(nix-instantiate --eval -E '<darwin-config>' 2> /dev/null || echo '***')\" ];" >&2
echo >&2
exit 2
fi