I’d like to write a flake that exports “parametrized” packages i.e. derivations like
website = { api_path ? "example.com" }: mkDerivation { postPatch = "code to replace api url in js code" };
How should I export this in my flake? I guess packages are only fon non-parametrized packages. I plan to add a nixos module but I also would like to provide an option for non-nixos users.
Oh I see elegant solution, thanks! Also is there a way to put generic nix helper functions not related to packages available to users of the flake? I guess I can put it in a randon attribute of the output but there are maybe some conventions?