mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
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.
This commit is contained in:
parent
c6d4cb31d7
commit
ce76393bb7
6 changed files with 40 additions and 11 deletions
|
|
@ -28,6 +28,9 @@ in
|
|||
${lib.optionalString (
|
||||
cfg.backupFileExtension != null
|
||||
) "export HOME_MANAGER_BACKUP_EXT=${lib.escapeShellArg cfg.backupFileExtension}"}
|
||||
${lib.optionalString (
|
||||
cfg.backupCommand != null
|
||||
) "export HOME_MANAGER_BACKUP_COMMAND=${lib.escapeShellArg cfg.backupCommand}"}
|
||||
${lib.optionalString cfg.overwriteBackup "export HOME_MANAGER_BACKUP_OVERWRITE=1"}
|
||||
${lib.optionalString cfg.verbose "export VERBOSE=1"}
|
||||
exec ${usercfg.home.activationPackage}/activate --driver-version ${driverVersion} >&2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue