2024-01-06 00:10:42 +01:00
|
|
|
{ modules, ... }:
|
|
|
|
{
|
2024-02-08 14:14:25 +01:00
|
|
|
_module.args = {
|
2023-12-06 13:09:26 +01:00
|
|
|
modules =
|
|
|
|
pkgs:
|
|
|
|
let
|
|
|
|
nixpkgsMaintainersList = pkgs.path + "/nixos/modules/misc/meta.nix";
|
|
|
|
|
|
|
|
nixvimExtraArgsModule = rec {
|
|
|
|
_file = ./flake.nix;
|
|
|
|
key = _file;
|
|
|
|
config = {
|
|
|
|
_module.args = {
|
|
|
|
pkgs = pkgs.lib.mkForce pkgs;
|
|
|
|
inherit (pkgs) lib;
|
2024-05-05 19:39:35 +02:00
|
|
|
};
|
2023-12-06 13:09:26 +01:00
|
|
|
};
|
|
|
|
};
|
2024-02-08 14:14:25 +01:00
|
|
|
in
|
|
|
|
[
|
|
|
|
../modules
|
|
|
|
nixpkgsMaintainersList
|
|
|
|
nixvimExtraArgsModule
|
2024-02-20 21:20:59 +01:00
|
|
|
(
|
|
|
|
{ lib, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
# Attribute may contain the following fields:
|
2024-06-07 21:30:00 +01:00
|
|
|
# - path: Path to the module, e.g. [ "plugins" "<name>" ]
|
2024-03-21 12:04:09 +01:00
|
|
|
# - description: A short description of the plugin
|
2024-02-20 21:20:59 +01:00
|
|
|
# - url: Url for the plugin
|
|
|
|
#
|
|
|
|
# We need to use an attrs instead of a submodule to handle the merge.
|
|
|
|
options.meta.nixvimInfo = mkOption {
|
|
|
|
type = (types.nullOr types.attrs) // {
|
|
|
|
# This will create an attrset of the form:
|
2024-06-07 21:30:00 +01:00
|
|
|
#
|
|
|
|
# { path.to.plugin.name = <info>; }
|
|
|
|
#
|
2024-02-20 21:20:59 +01:00
|
|
|
#
|
|
|
|
# Where <info> is an attrset of the form:
|
2024-03-21 12:04:09 +01:00
|
|
|
# {
|
|
|
|
# file = "path";
|
|
|
|
# description = null or "<DESCRIPTION>";
|
|
|
|
# url = null or "<URL>";
|
|
|
|
# }
|
2024-02-20 21:20:59 +01:00
|
|
|
merge =
|
|
|
|
_: defs:
|
|
|
|
lib.foldl'
|
|
|
|
(
|
|
|
|
acc: def:
|
2024-06-07 21:30:00 +01:00
|
|
|
lib.recursiveUpdate acc (
|
|
|
|
setAttrByPath def.value.path {
|
2024-02-20 21:20:59 +01:00
|
|
|
inherit (def) file;
|
2024-06-07 21:30:00 +01:00
|
|
|
url = def.value.url or null;
|
|
|
|
description = def.value.description or null;
|
|
|
|
}
|
|
|
|
)
|
2024-02-20 21:20:59 +01:00
|
|
|
)
|
|
|
|
{
|
|
|
|
plugins = { };
|
|
|
|
colorschemes = { };
|
|
|
|
}
|
|
|
|
defs;
|
|
|
|
};
|
|
|
|
internal = true;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Nixvim related information on the module
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
2024-02-08 14:14:25 +01:00
|
|
|
];
|
2023-12-06 13:09:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
perSystem =
|
|
|
|
{ pkgs, config, ... }:
|
|
|
|
{
|
|
|
|
_module.args = {
|
|
|
|
modules = modules pkgs;
|
2024-02-03 19:04:09 +01:00
|
|
|
rawModules = modules;
|
2024-05-05 19:39:35 +02:00
|
|
|
};
|
2023-12-06 13:09:26 +01:00
|
|
|
};
|
|
|
|
}
|