Support defining overlays
Is your feature request related to a problem? Please describe.
I define overlays. Nix gets in the way. Blueprint doesn't solve it.
Describe the solution you'd like
These files:
flake.nix
overlays/default/default.nix
overlays/other.nix
Should produce these flake outputs:
overlays.default
overlays.other
Describe alternatives you've considered
https://snowfall.org/guides/lib/overlays/
Additional context
I'm migrating from snowfallorg-lib.
@moduon MT-9339
For now this is not supported by the ilesystem but you can still configure blueprint like this: https://github.com/numtide/blueprint/blob/main/docs/configuration.md#nixpkgsoverlays
Is there a specific use-case where overlays are needed for you? Most of the time we can avoid the overlays by composing flakes together.
Not something that I can't do in some other way, but given it's a common pattern, a standard flake output and a useful feature, I was surprised that it wasn't supported in the standard filesystem hierarchy.
I use one overlay FWIW: https://gitlab.com/yajoman/minfra/-/blob/1a59ff81a39bdc70883103f97881a088ed53ff22/overlays/element-web/default.nix
I managed to get out of it with packages, but I'm not sure if it was better how it was before.
+1, right now im bootstrapping my overlays:
overlays/default.nix
{inputs, ...}: {
additions = final: _prev: {
stable = import inputs.nixpkgs-stable {
inherit (final) system config;
};
master = import inputs.nixpkgs-master {
inherit (final) system config;
};
};
olympus = final: _prev: {
inherit (inputs.olympus.legacyPackages.${final.system}) olympus;
};
}
i think we could do something like this:
overlays.<overlay> = {pkgs}: import <overlay path> systemArgs.${pkgs.system};
and thus when it is imported on the host it provides the needed systemArgs
and i could then do this for olympus:
{inputs, perSystem, ...}: {
...
olympus = _final: _prev: {inherit (perSystem.olympus) olympus;}
and bonus point, you could now do this for the flake:
outputs = {blueprint, self, ...} @ inputs:
blueprint {
inherit inputs;
nixpkgs.overlays = with self.overlays; [ <overlay>];
};
but i dont think this will work out the box, since pkgs isnt passed to the overlay (to get the system for the systemArgs)