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.
This commit is contained in:
Robert Helgesson 2018-02-27 20:31:03 +01:00
parent b47cc4bc66
commit 19b4002f25
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86
2 changed files with 7 additions and 1 deletions

View file

@ -313,7 +313,6 @@ in
pkgs.gnugrep
pkgs.gnused
pkgs.ncurses # For `tput`.
pkgs.nix
]
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";

View file

@ -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"