nix-community.nixvim/modules/top-level/files/submodule.nix
2024-07-05 17:21:56 +01:00

22 lines
424 B
Nix

{
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;
};
}