Files
Matt Sturgeon fca03f1759 lib: allow instantiating without a flake instance
Separate `overlay.nix` and `overlay.internal.nix`, to encapsulate the
`flake` argument. This allows non-flake users to import `./overlay.nix`
without providing a dummy `flake = null` attr.

The read-only `config.flake` option is only defined by `evalNixvim` when
`lib` is extended using the overlay in Nixvim's flake outputs.
2026-05-24 03:05:36 +00:00

37 lines
832 B
Nix

{
self,
config,
lib,
withSystem,
inputs,
...
}:
{
# Public `lib` flake output
flake.lib = {
nixvim = lib.makeOverridable ({ lib }: (lib.extend self.lib.overlay).nixvim) {
# NOTE: Use the lib from nixpkgs pin to prevent a dependency
# on pinning the flake-parts nixpkgs-lib to the nixpkgs pin
inherit (inputs.nixpkgs) lib;
};
overlay = import ../lib/overlay.internal.nix {
flake = self;
};
# Top-top-level aliases
inherit (self.lib.nixvim)
evalNixvim
;
}
// lib.genAttrs config.systems (
lib.flip withSystem (
{ pkgs, system, ... }:
{
# NOTE: this is the publicly documented flake output we've had for a while
check = pkgs.callPackage ../lib/tests.nix {
inherit lib self system;
};
}
)
);
}