nix-community.nixvim/flake-modules/lib.nix
Matt Sturgeon bef9feb446
lib/modules: pass inputs.nixpkgs into evalNixvim
Expose our locked nixpkgs as the `nixpkgs.source` module options.

This only happens when `evalNixvim` is part of a lib that was provided
`flake` as an argument.

Stubbed the `nixpkgs.source` option for now. Eventually, this will be
used to construct `pkgs` internally. For now, it's purely informational.
2024-12-15 18:41:23 +00:00

29 lines
597 B
Nix

{
self,
config,
lib,
withSystem,
...
}:
{
_module.args.helpers = import ../lib {
inherit lib;
flake = self;
};
# TODO: output lib without pkgs at the top-level
flake.lib = lib.genAttrs config.systems (
lib.flip withSystem (
{ pkgs, ... }:
{
# NOTE: this is the publicly documented flake output we've had for a while
check = import ../lib/tests.nix { inherit self lib pkgs; };
# TODO: no longer needs to be per-system
helpers = import ../lib {
inherit lib;
flake = self;
};
}
)
);
}