What's the best way to include configuration files with programs in a flake?

I’m interested in creating a flake that I can use for a personal Helix configuration.

Configuring Helix is easy - it’s a single configuration file. And installing Helix within a flake is also easy - it’s just pkgs.helix.

What I’m unsure about is how to do these together. I’d like to be able to use this flake modularly - meaning that when I’m defining flakes for downstream projects, I can reference my helix flake so that my editing environment is included with the project definition.

I know I could do this using home-manager, but that’s a little beside the point right now. I’d like to be able to use the flake on machines other than my own - and, if done properly, I could even just reference this same flake in home-manager rather than duplicating the config there.

Does the question make sense? I assume there’s some very easy way to do this, but I don’t know where to start.

Thanks!

1 Like

One way is ti use wrappers - these are I think effectively packaging up the app and setting encvionment variables/command line to read its config from /nix/store. Obviously the config is read only there.

One way to do this is using @vipelML’s wrapper-manager

1 Like

This is exactly what I was looking for! Thank you.