I really love home-manager’s
home.file.<target>.source = <source>
feature [though I have recently started using a more flexible variation on the theme
{ config, pkgs, ... }:
link = config.lib.file.mkOutOfStoreSymlink;
in
{
home.file.<target>.source = link <source>;
}
but that’s not directly relevant here].
If the target already exists (and wasn’t put there by home-manager in the first place) home-manager switch
fails with the very reasonable error message
Existing file '/home/whoever/target' is in the way of '/nix/store/x0jc9dfic44p8kxm1vmdm1d0wclx1pc6-home-manager-files/target'
Please move the above files and try again or use -b <ext> to move automatically.
man home-manager
has this to say about -b
:
-b extension
Enable automatic resolution of collisions between unmanaged and managed files. The name of the original file will be suffixed by the given extension. For example,
$ home-manager -b bck switch
will cause a colliding file ~/.config/foo.conf to be moved to ~/.config/foo.conf.bck.
As man pages go, this is unusually lucid.
All good stuff! So what’s the problem? Well, executing
home-manager -b bck switch
gives exactly the same error as before.
I’ve been staring at this for a while and two possible explanations come to mind:
- I’m missing something bloody obvious
-
home-manager -b
is broken
Any ideas?