1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 16:27:03 +00:00

activation-checks: add check for user channels

This commit is contained in:
Daiderd Jordan 2017-09-06 23:55:14 +02:00
parent 184e9f34be
commit 9f0507cf7d
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -34,6 +34,25 @@ let
fi
'';
nixChannels = ''
channelsLink=$(readlink "$HOME/.nix-defexpr/channels") || true
case "$channelsLink" in
*"$USER"*)
;;
"")
;;
*)
echo "error: The ~/.nix-defexpr/channels symlink does not point your users channels" >&2
echo "Running nix-channel will regenerate it" >&2
echo >&2
echo " rm ~/.nix-defexpr/channels" >&2
echo " nix-channel --update" >&2
echo >&2
exit 2
;;
esac
'';
nixPath = ''
darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin-config>') || true
if ! test -e "$darwinConfig"; then
@ -84,6 +103,7 @@ in
system.activationScripts.checks.text = ''
${darwinChanges}
${buildUsers}
${nixChannels}
${nixPath}
if test ''${checkActivation:-0} -eq 1; then