mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 17:58:38 +02:00
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.
56 lines
1.3 KiB
Nix
56 lines
1.3 KiB
Nix
default_pkgs: self:
|
|
{
|
|
# TODO: Deprecate this arg in favour of using module options
|
|
pkgs ? default_pkgs,
|
|
lib ? pkgs.lib,
|
|
extraSpecialArgs ? { },
|
|
_nixvimTests ? false,
|
|
module,
|
|
}:
|
|
let
|
|
# NOTE: we are importing this just for evalNixvim
|
|
helpers = import ../lib {
|
|
inherit lib _nixvimTests;
|
|
flake = self;
|
|
};
|
|
|
|
inherit (helpers.modules) evalNixvim;
|
|
|
|
mkNvim =
|
|
mod:
|
|
let
|
|
nixvimConfig = evalNixvim {
|
|
modules = [
|
|
mod
|
|
# TODO: only include this when `args?pkgs`:
|
|
{
|
|
_file = ./standalone.nix;
|
|
nixpkgs.pkgs = lib.mkDefault pkgs;
|
|
}
|
|
];
|
|
inherit extraSpecialArgs;
|
|
};
|
|
inherit (nixvimConfig.config) enableMan build;
|
|
in
|
|
(pkgs.symlinkJoin {
|
|
name = "nixvim";
|
|
paths = [
|
|
build.package
|
|
build.printInitPackage
|
|
] ++ pkgs.lib.optional enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs;
|
|
meta.mainProgram = "nvim";
|
|
})
|
|
// rec {
|
|
inherit (nixvimConfig) config options;
|
|
extend =
|
|
extension:
|
|
mkNvim {
|
|
imports = [
|
|
mod
|
|
extension
|
|
];
|
|
};
|
|
nixvimExtend = lib.warn "<nixvim>.nixvimExtend has been renamed to <nixvim>.extend" extend;
|
|
};
|
|
in
|
|
mkNvim module
|