From 758d2ef9c132fa9ddeb0adb920f33efbe1f8344f Mon Sep 17 00:00:00 2001 From: Cornelius Mika Date: Thu, 17 Aug 2017 10:16:26 +0200 Subject: [PATCH] home-manager: show full script path on activation error Run the activation script in its original nix-store location so that Bash error messages show the real script location instead of 'wrkdir', which gets deleted right after the script exits. (cherry picked from commit 02a501705a11f14ddc21a215c01ed3c1c16a007c) --- home-manager/home-manager | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index f599d900..45fe0e1c 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -91,8 +91,9 @@ function doSwitch() { local wrkdir wrkdir="$(mktemp -d)" + local generation local exitCode=0 - doBuild "$wrkdir/generation" && "$wrkdir/generation/activate" || exitCode=1 + generation=$(doBuild "$wrkdir/result") && $generation/activate || exitCode=1 # Because the previous command never fails, the script keeps running and # $wrkdir is always removed.