From dcbe0f2a31715f62a040b6602eece9c7282d191f Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 20 May 2020 22:17:37 +0200 Subject: [PATCH] home-manager: add activation sanity check of Nix This adds an empty `nix-build` command to verify that the user is having a good Nix install. It also, as a side effect, will create the necessary per-user `profiles` and `gcroots` directories. Fixes #1246 --- modules/lib-bash/activation-init.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/lib-bash/activation-init.sh b/modules/lib-bash/activation-init.sh index 5da81e184..ecf1f550c 100755 --- a/modules/lib-bash/activation-init.sh +++ b/modules/lib-bash/activation-init.sh @@ -50,6 +50,11 @@ fi echo "Starting home manager activation" +# Verify that we can connect to the Nix store and/or daemon. This will +# also create the necessary directories in profiles and gcroots. +$VERBOSE_ECHO "Sanity checking Nix" +nix-build --expr '{}' --no-out-link + setupVars if [[ -v DRY_RUN ]] ; then