modules/output: Allow to specify text to add as extra files (#343)

To enable some features (like adding tree-sitter queries) we need to add
files to specific directories in the runtime path (queries/lang/file.scm
for tree-sitter queries for example).

This commit adds support for specifying such files. You must be careful
to not have any collisions between `files` and `extraFiles`.
This commit is contained in:
traxys 2023-04-21 20:04:58 +02:00 committed by GitHub
parent 52120a891d
commit 5a498edd14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 8 deletions

View file

@ -57,8 +57,9 @@ in {
# A directory with all the files in it
filesPlugin = pkgs.buildEnv {
name = "nixvim-config";
paths = lib.mapAttrsToList (_: file: file.plugin) files;
ignoreCollisions = true; # Collisions can't happen by construction
paths =
(lib.mapAttrsToList (_: file: file.plugin) files)
++ (lib.mapAttrsToList (path: content: pkgs.writeTextDir path content) config.extraFiles);
};
};
}