I’m refactoring my Nix configuration, and along the way I saw that I will need to do something that, in fact, can’t be done by default and I don’t know how to get around it either:
I have the configuration of a program split into two folders in my Nix configuration:
dir_1/file_1
dir_2/file_2
My intention is that, using the home.file attribute of home-manager, I can create the respective link in the program configuration that, in the same directory, has file_1 and file_2. That is to say, I need that the directory of my home looks like this
user/.config/program/
file_1
file_2
The problem is that home.file only allows one source, so something like:
It doesn’t work. And of course, much less create two entries with the same attribute. So, does anyone know how to get around the problem? Is it possible to “concatenate” the content of two directories and pass it as a path to “source”?
Thank you very much for your help!
Additional info: In case it helps, each folder will have more than one file, that’s why I add the recursive.
Yes, I saw that too but your proposal to use symlinkJoin looks very promising to me! I will try that way.
That’s what I’m doing at the moment, however, both directories will have a lot of files, and I change them frequently, so this solution may be tedious in the long run. Still thanks for the reply, it took me a couple of hours to remember that I could do it as a workaround!
Thanks you both for your answers. I will report back if I am successful with the alternative.