Skip to content
Matthieu Coudron edited this page Mar 24, 2026 · 3 revisions

Backup

There are many questions about how to have home-manager successfully deployed despite existing configurations. Checkout the nixos module home-manager.backupCommand option to override the default backup behavior. If you dont care about backups, you can also set home.file."file.foo".force = true; to force overwriting of existing file.

How to symlink some files without copying their content in the store ?

Use home.file."file.foo".source = config.lib.file.mkOutOfStoreSymlink ./path/to/file/to/link;.

How to change where home-manager generates a program configuration ?

Sometimes you don't want home-manager to write into the main configuration file of the program. This can be because you want to keep control of the main file because you use this files on computers without home-manager or because the program can't work with a read-only configuration file. For instance vicinae interactive configuration fails when the settings are generated via HM. When the program supports the import of other files (neovim, jujutsu, vicinae, neomutt etc), you can do:

  configFile."vicinae/settings.json".enable = false;
    # You can still refer to its generated content via:
  configFile."vicinae/generated.json".source = config.xdg.configFile."vicinae/settings.json".source;

and in your manual config ~/.config/vicinae/settings.json, you reference the generated file (this depends on the program):

{
   "imports": [
      "generated.json",
   ],
   ...
}

Clone this wiki locally