numtide / blueprint

Nix without the glue code
40 stars 3 forks source link

feat: allow extra args to be passed #16

Open brianmcgee opened 2 months ago

brianmcgee commented 2 months ago

I tend to customise nixpkgs.lib in my projects using extensions. To accommodate this in a 'blueprint' style I've added extraArgs rather than trying to further customise nixpkgs. This has the added benefit of accommodating wider use cases.

  outputs =
    inputs:
    inputs.blueprint {
      inherit inputs;
      extraArgs = {
        lib = inputs.nixpkgs.lib.extend (import ./lib.nix);
      };
    };
phaer commented 2 months ago

Only saw this now, needs a rebase

zimbatm commented 2 months ago

Still mulling a bit over this.

Notice how the ./lib.nix is loaded with no inputs, so it can only deal with builtins.

Maybe something like this would be better:

extraArgs = { flake, ... }: {
  lib = inputs.nixpkgs.lib.extend flake.lib;
};

We're slowly converging towards a module system.