From f8e6694edabe4aaa7a85aac47b43ea5d978b116d Mon Sep 17 00:00:00 2001 From: Lichthagel Date: Mon, 29 Apr 2024 23:13:35 +0200 Subject: [PATCH] files: make collision error message more helpful Most importantly, also indicate how to use file backup for NixOS and nix-darwin modules. --- modules/files/check-link-targets.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/files/check-link-targets.sh b/modules/files/check-link-targets.sh index c3200d336..215ff6c37 100644 --- a/modules/files/check-link-targets.sh +++ b/modules/files/check-link-targets.sh @@ -48,6 +48,12 @@ for sourcePath in "$@" ; do done if [[ -v collision ]] ; then - errorEcho "Please move the above files and try again or use 'home-manager switch -b backup' to back up existing files automatically." + errorEcho "Please do one of the following: +- Move or remove the above files and try again. +- In standalone mode, use 'home-manager switch -b backup' to back up + files automatically. +- When used as a NixOS or nix-darwin module, set + 'home-manager.backupFileExtension' + to, for example, 'backup' and rebuild." exit 1 fi