nix-community.nixvim/modules/top-level/files/submodule.nix

23 lines
424 B
Nix
Raw Normal View History

{
name,
config,
lib,
pkgs,
...
}:
{
options = {
plugin = lib.mkOption {
type = lib.types.package;
description = "A derivation with the content of the file in it";
readOnly = true;
internal = true;
};
};
config = {
path = name;
type = lib.mkDefault (if lib.hasSuffix ".vim" name then "vim" else "lua");
plugin = pkgs.writeTextDir config.path config.content;
};
}