mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
Instead of `pkgs.writeText`, use `helpest.writeLua` to ensure the file is formatted with stylua.
27 lines
609 B
Nix
27 lines
609 B
Nix
{
|
|
name,
|
|
config,
|
|
lib,
|
|
helpers,
|
|
...
|
|
}:
|
|
{
|
|
options = {
|
|
plugin = lib.mkOption {
|
|
type = lib.types.package;
|
|
description = "A derivation with the content of the file in it";
|
|
readOnly = true;
|
|
internal = true;
|
|
};
|
|
};
|
|
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.
|
|
plugin = helpers.writeLua derivationName config.content;
|
|
};
|
|
}
|