mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-12 03:51:07 +01:00
home-environment: colorize activation output slightly
This commit is contained in:
parent
870d1d484d
commit
3ee505179f
3 changed files with 42 additions and 4 deletions
|
|
@ -252,6 +252,8 @@ in
|
|||
let
|
||||
pattern = "-home-manager-files/";
|
||||
check = pkgs.writeText "check" ''
|
||||
. ${./lib-bash/color-echo.sh}
|
||||
|
||||
newGenFiles="$1"
|
||||
shift
|
||||
for sourcePath in "$@" ; do
|
||||
|
|
@ -259,13 +261,13 @@ in
|
|||
targetPath="$HOME/$relativePath"
|
||||
if [[ -e "$targetPath" \
|
||||
&& ! "$(readlink -e "$targetPath")" =~ "${pattern}" ]] ; then
|
||||
echo -e "Existing file '$targetPath' is in the way"
|
||||
errorEcho "Existing file '$targetPath' is in the way"
|
||||
collision=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -v collision ]] ; then
|
||||
echo -e "Please move the above files and try again"
|
||||
errorEcho "Please move the above files and try again"
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
|
|
@ -356,7 +358,7 @@ in
|
|||
home.activationPackage =
|
||||
let
|
||||
mkCmd = res: ''
|
||||
echo Activating ${res.name}
|
||||
noteEcho Activating ${res.name}
|
||||
${res.data}
|
||||
'';
|
||||
sortedCommands = dagTopoSort cfg.activation;
|
||||
|
|
@ -373,7 +375,9 @@ in
|
|||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
${builtins.readFile ./activation-init.sh}
|
||||
. ${./lib-bash/color-echo.sh}
|
||||
|
||||
${builtins.readFile ./lib-bash/activation-init.sh}
|
||||
|
||||
${activationCmds}
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue