I’m using NixOS (24.05, unstable) with Home Manager to configure my Firefox. It often happened that nixos-rebuild switch failed because Home Manager wanted to override an existing config file (/home/rob/.mozilla/firefox/rob/search.json.mozlz4). So I activated the Home Manager option home-manager.backupFileExtension = "backup", which would backup the file with an extension instead of just overwriting it. But now the NixOS rebuild fails again, but with the backed up file:
Existing file '/home/rob/.mozilla/firefox/rob/search.json.mozlz4.backup' would be clobbered by backing up '/home/rob/.mozilla/firefox/rob/search.json.mozlz4'
What am I missing? Is there an option to tell Home Manager to just overwrite the backed up file?
I also have some home activation issues while I’m using backFileExtension, there is an issue open.
I recently tried to use a timestamp in backupFileExtension as a workaround, but the timestamp is not refreshed on home activation (got the timestamp trick here, but I failed to use builtins.currentTime):
I use a hacky workaround for this with a custom script to build nixos which renames the {filename}.backup file to {filename}.bak (with home-manager.backupFileExtension = "backup".