mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-23 20:25:08 +02:00
modules: refactor extraFiles
Moved `extraFiles` from `modules/output.nix` into its own file `modules/files.nix`. Users should now assign text to a `text` attribute, however they could also assign a file path to a `source` attribute instead. The old method of directly assigning a string still works, and is coerced to the new type along with a deprecation warning.
This commit is contained in:
parent
c12694f4ba
commit
086873bed9
8 changed files with 157 additions and 28 deletions
|
@ -14,9 +14,14 @@
|
|||
internal = true;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
path = name;
|
||||
type = lib.mkDefault (if lib.hasSuffix ".vim" name then "vim" else "lua");
|
||||
plugin = pkgs.writeTextDir config.path config.content;
|
||||
};
|
||||
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 = pkgs.writeText derivationName config.content;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue