From 19b4002f25cc468b4242de05099ae22bf75704c3 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 27 Feb 2018 20:31:03 +0100 Subject: [PATCH] home-environment: use nix-env from PATH It is safest to use the system install of Nix since that will be compatible with the running nix-daemon and/or databases. Also add a printout of the used Nix version in the activation script when running in verbose mode. Fixes #218. --- modules/home-environment.nix | 1 - modules/lib-bash/activation-init.sh | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 164d3e9c3..c6fc345d7 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -313,7 +313,6 @@ in pkgs.gnugrep pkgs.gnused pkgs.ncurses # For `tput`. - pkgs.nix ] + optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH"; diff --git a/modules/lib-bash/activation-init.sh b/modules/lib-bash/activation-init.sh index 1239e18e2..b5472504c 100755 --- a/modules/lib-bash/activation-init.sh +++ b/modules/lib-bash/activation-init.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + function setupVars() { local profilesPath="/nix/var/nix/profiles/per-user/$USER" local gcPath="/nix/var/nix/gcroots/per-user/$USER" @@ -46,6 +48,11 @@ else export DRY_RUN_CMD="" fi +if [[ -v VERBOSE ]]; then + echo -n "Using Nix version: " + nix-env --version +fi + $VERBOSE_ECHO "Activation variables:" if [[ -v oldGenNum ]] ; then $VERBOSE_ECHO " oldGenNum=$oldGenNum"