From 243651e398771dfe1bdcb10fdfc36497896c05cb Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 13 Jan 2018 22:50:48 +0100 Subject: [PATCH] checks: add test for /run --- modules/system/activation-checks.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/system/activation-checks.nix b/modules/system/activation-checks.nix index 0379e0b7..ad20a31d 100644 --- a/modules/system/activation-checks.nix +++ b/modules/system/activation-checks.nix @@ -19,6 +19,17 @@ let fi ''; + runLink = '' + if ! test -e /run; then + echo "error: Directory /run does not exist, aborting activation" >&2 + echo "Create a symlink to /var/run with:" >&2 + echo >&2 + echo " sudo ln -s private/var/run /run" >&2 + echo >&2 + exit 2 + fi + ''; + buildUsers = optionalString config.services.nix-daemon.enable '' buildUser=$(dscl . -read /Groups/nixbld GroupMembership 2>&1 | awk '/^GroupMembership: / {print $2}') || true if [ -z $buildUser ]; then @@ -42,7 +53,7 @@ let "") ;; *) - echo "error: The ~/.nix-defexpr/channels symlink does not point your users channels" >&2 + echo "error: The ~/.nix-defexpr/channels symlink does not point your users channels, aborting activation" >&2 echo "Running nix-channel will regenerate it" >&2 echo >&2 echo " rm ~/.nix-defexpr/channels" >&2 @@ -118,6 +129,7 @@ in system.activationScripts.checks.text = '' ${darwinChanges} + ${runLink} ${buildUsers} ${nixChannels} ${nixInstaller}