This adds a new backupCommand option to allow users to specify a
custom command to run on existing files during activation, as an
alternative to the existing backupFileExtension mechanism.
Adds backupCommand option to NixOS and nix-darwin modules.
Exports HOME_MANAGER_BACKUP_COMMAND environment variable when set.
Updates file activation logic to use the custom backup command if
provided, falling back to the existing backup extension logic.
Updates collision checking and user-facing instructions to
mention the new option.
This enables advanced backup workflows, such as moving files to
trash or archiving with custom tools, before managing them with
Home Manager.
When using the backupFileExtension option, if the backup file exists,
the activation process fails. This adds an option to instead overwrite
the old backup instead of failing.
Render each bullet as a single line at runtime while keeping ~80-column source formatting. Prevents truncation of the colliding path in service logs, reducing the need to inspect journal output.
Before:
> Existing file '' would be clobbered by backing up '/home/winter/.config/fish/config.fish'
After:
> Existing file '/home/winter/.config/fish/config.fish' would be clobbered