mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-05 08:17:01 +00:00
activation-checks: add check for user channels
This commit is contained in:
parent
184e9f34be
commit
9f0507cf7d
1 changed files with 20 additions and 0 deletions
|
@ -34,6 +34,25 @@ let
|
|||
fi
|
||||
'';
|
||||
|
||||
nixChannels = ''
|
||||
channelsLink=$(readlink "$HOME/.nix-defexpr/channels") || true
|
||||
case "$channelsLink" in
|
||||
*"$USER"*)
|
||||
;;
|
||||
"")
|
||||
;;
|
||||
*)
|
||||
echo "[1;31merror: The ~/.nix-defexpr/channels symlink does not point your users channels[0m" >&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
|
||||
|
|
Loading…
Add table
Reference in a new issue