home-manager: add backup overwrite option

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.
This commit is contained in:
saygo-png
2025-10-01 11:45:00 -05:00
committed by Austin Horstman
parent 7500458e85
commit 004753ae6b
5 changed files with 21 additions and 8 deletions
+1
View File
@@ -28,6 +28,7 @@ in
${lib.optionalString (
cfg.backupFileExtension != null
) "export HOME_MANAGER_BACKUP_EXT=${lib.escapeShellArg cfg.backupFileExtension}"}
${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
''}