Dotfile management

I’m sure the subject has come up plenty but I have a couple of questions that I’ve not been able to find the answer to.

I’ve decided to keep my dotfiles in git so my configurations can easily be pulled onto a variety of machines. I have some NixOS and a bunch of Ubuntu so I think it’s probably better to keep the repository separate from my NixOS. I have 2 questions.

  1. Say I want to manage the file another way, how do I tell NixOS not to manage a file. Say ~/.ssh/config for example.

  2. Can I, in Nix, import a file’s contents from an external git repository or would it have to be in the same repository? (if it is relevant I am using flakes and home manager managed centrally with my main NixOS configuration)

NixOS does not manage files in $HOME generally.

You can add a new flake input or use a fetcher.

1 Like

Some of the ssh files are being managed, perhaps it is home manager doing so? Same question though, can I tell home manager to not manage them? The ssh file I mentioned is managed but I don’t create it knowingly in my configuration.

Then don’t enable the ssh option in HM.

1 Like

Ah yes, that should have been obvious. Thanks. I’ll move that to my Nixos config