2024-07-05 16:48:46 +01:00
|
|
|
{
|
|
|
|
name,
|
|
|
|
config,
|
|
|
|
lib,
|
2024-07-07 16:44:17 +01:00
|
|
|
helpers,
|
2024-07-05 16:48:46 +01:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
plugin = lib.mkOption {
|
|
|
|
type = lib.types.package;
|
|
|
|
description = "A derivation with the content of the file in it";
|
|
|
|
readOnly = true;
|
|
|
|
internal = true;
|
|
|
|
};
|
|
|
|
};
|
2024-07-07 16:09:31 +01:00
|
|
|
config =
|
|
|
|
let
|
|
|
|
derivationName = "nvim-" + lib.replaceStrings [ "/" ] [ "-" ] name;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
path = lib.mkDefault name;
|
|
|
|
type = lib.mkDefault (if lib.hasSuffix ".vim" name then "vim" else "lua");
|
|
|
|
# No need to use mkDerivedConfig; this option is readOnly.
|
2024-07-07 16:44:17 +01:00
|
|
|
plugin = helpers.writeLua derivationName config.content;
|
2024-07-07 16:09:31 +01:00
|
|
|
};
|
2024-07-05 16:48:46 +01:00
|
|
|
}
|