I was originally going to post this because it wasn’t quite working and I needed help. Maybe when I have more nested attributes they won’t quite merge correctly and I’ll need to better understand merging then.
Since it is working though, I guess this is a request for feedback and to see what others do to solve the problem of modularizing their home-manager configs.
Here is a screenshot I think describes everything:
I want to know if this is a good way to modularize or am I missing out on a simpler solution?
I use home-manager for personal things and work things across both laptops, desktops, and hopefully soon phones with android on nix. I make 4 files for this:
Personal and work have a lot in common, so I’m putting those common things in core.nix. For instance my
git.userName is always the same, but my work.nix and personal.nix will customize
git.userEmail differently as seen in the screenshot.
I’m curious to see how others solve the problem and/or they have any suggested improvements to this method.
Figuring out I needed to use
lib.mkMerge and that
// wouldn’t work correctly for me was a little tough and required going to IRC quite a few times until I understood or asked my question clearly enough.
I don’t have any ideas on how that would be improved, but wanted to note my experience/struggles nonetheless in case others may think of ideas to smooth it out.