I have a very long .gitignore_global
file.
Home Manager’s Appendix A. Configuration Options for git ignoring files via programs.git.ignores
shows the example:
[
"*~"
"*.swp"
]
Looking at Declarative management of dotfiles with Nix and Home Manager example of programs.git.includes
:
programs.git = {
enable = true;
includes = [
{ path = "~/.gitlocalconfig"; }
];
...
};
Is this how to have git ignore files via Home Manager?
programs.git = {
enable = true;
ignores = [
"*~"
"*.swp"
];
...
};
If so, would I be better to use the:
-
include option (as per example above) to include a path to existing
.gitignore_global
file? -
the
extraConfig
option toset core.excludesFile = ".gitignore_global";
-
copy everything in my existing
.gitignore_global
file to whatever the correct format forprograms.git.ignores
is?
My preference is use nix home manager’s ‘way’/options as much as possible, but the last option - copying everything to programs.git.ignores
just appears too fragile and noisy (unless it’s possible to breakout that option to another file?), and I’m confused whether I should use 1 or 2 above instead.
How are you handling large/long global gitignore files with home manager?
Lastly, if I were to use option 2, how is it possible to path my .gitignore_global
file located in the directory home manager creates (on my system) ~/.config/git/.gitignore_global
?