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:
Matt Sturgeon 2024-07-07 16:09:31 +01:00
parent c12694f4ba
commit 086873bed9
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
8 changed files with 157 additions and 28 deletions

View file

@ -1,7 +1,13 @@
{
query = {
extraFiles = {
"queries/lua/injections.scm" = ''
"testing/test-case.nix".source = ./extra-files.nix;
"testing/123.txt".text = ''
One
Two
Three
'';
"queries/lua/injections.scm".text = ''
;; extends
'';
};