mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
Let's simplify things by defining all modules in `./plugins`, `./modules` and `./wrappers/modules`. Instead of currying `pkgs` into a bootstrapping module, we can require `defaultPkgs` be provided as a special arg. This refactor allows us to completely remove `flake-modules/modules.nix`!
29 lines
722 B
Nix
29 lines
722 B
Nix
helpers:
|
|
{ lib, config, ... }:
|
|
let
|
|
inherit (lib) mkOption mkOptionType;
|
|
cfg = config.programs.nixvim;
|
|
in
|
|
{
|
|
topLevelModules = [
|
|
../modules
|
|
./modules/output.nix
|
|
./modules/files.nix
|
|
];
|
|
|
|
helpers = mkOption {
|
|
type = mkOptionType {
|
|
name = "helpers";
|
|
description = "Helpers that can be used when writing nixvim configs";
|
|
check = builtins.isAttrs;
|
|
};
|
|
description = "Use this option to access the helpers";
|
|
default = helpers;
|
|
};
|
|
|
|
configFiles =
|
|
(lib.mapAttrs' (_: file: lib.nameValuePair "nvim/${file.path}" { text = file.content; }) cfg.files)
|
|
// (lib.mapAttrs' (
|
|
path: content: lib.nameValuePair "nvim/${path}" { text = content; }
|
|
) cfg.extraFiles);
|
|
}
|