mirror of
https://github.com/nix-community/nixvim.git
synced 2026-08-24 02:34:15 -05:00
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.
37 lines
832 B
Nix
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;
|
|
};
|
|
}
|
|
)
|
|
);
|
|
}
|