blueprint icon indicating copy to clipboard operation
blueprint copied to clipboard

Support defining overlays

Open yajo opened this issue 10 months ago • 3 comments

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

yajo avatar Mar 12 '25 12:03 yajo

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.

zimbatm avatar Mar 12 '25 14:03 zimbatm

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.

yajo avatar Mar 12 '25 18:03 yajo

+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)

JumpIn-Git avatar Mar 23 '25 08:03 JumpIn-Git