Let’s say there is a project that comes with a nice default.nix. Is there a way, short of getting it into nixpkgs, to include configuration options with that project?
I.e. I’d like the user to be able to import the project derivation straight off github and enable its services, tweak its configs, etc., in the usual manner. Is that possible? If so, how?
(I avoid experimental features as a matter of policy, so without flakes)
thank you!
regarding your example: where is pkgs.neuron-notes supposed to come from?
also isn’t the way you bring in the module IFD, and thus somehow bad?
neuron-notes derivation and the module is decoupled right now. services.neuron.package defaults to neuron-notes attribute of pkgs argument passed by the module system, if services.neuron.package is not defined. To use a custom derivation, you can either use an overlay that overwrites neuron-notes attribute of pkgs or you can define services.neuron.package.
For example, if you want to use the neuron derivation from the repository, you can do
I think the reason IFD’s are looked down upon and not allowed in Nixpkgs is that they reduce Hydra’s parallelism ^1. Nix wiki page about IFD says the following
… As a rule of thumb, if you can avoid IFD by refactoring Nix code or moving your build logic into the derivations themselves, you should do so.
I don’t think it is possible to refactor the above Nix expression to avoid IFD’s, since it is only fetching external files. What we can do is fetch the dependencies before the evaluation starts. This could be done by using Flakes, niv or something similar.