2024-04-05 22:56:00 +02:00
|
|
|
{ config
|
|
|
|
, lib
|
|
|
|
, pkgs
|
|
|
|
, ...
|
|
|
|
}:
|
2024-04-22 12:13:08 +02:00
|
|
|
let
|
|
|
|
luaExpr = val: if val == null then "nil" else "[[${val}]]";
|
|
|
|
in
|
2024-04-05 22:56:00 +02:00
|
|
|
{
|
2024-04-10 18:03:17 +02:00
|
|
|
imports = [
|
2024-05-07 00:04:29 +02:00
|
|
|
./nvim-tools
|
2024-04-10 18:03:17 +02:00
|
|
|
./jvm.nix
|
2024-04-14 16:09:11 +02:00
|
|
|
./nvim-plugins.nix
|
2024-04-10 18:03:17 +02:00
|
|
|
./tree-sitter-parsers.nix
|
|
|
|
];
|
2024-04-05 22:56:00 +02:00
|
|
|
|
|
|
|
options.cgnix.entries = lib.mkOption {
|
|
|
|
default = { };
|
|
|
|
};
|
|
|
|
|
|
|
|
config.cgnix.entries."fennel.lua" = "${pkgs.luajitPackages.fennel}/share/lua/5.1/fennel.lua";
|
|
|
|
|
2024-06-17 21:17:17 +02:00
|
|
|
config.output.packages.cgnix = pkgs.writeTextFile {
|
2024-04-05 22:56:00 +02:00
|
|
|
name = "nix.lua";
|
|
|
|
text = ''
|
|
|
|
return {
|
2024-04-22 12:13:08 +02:00
|
|
|
${builtins.concatStringsSep "\n " (lib.mapAttrsToList (k: v: ''["${k}"] = ${luaExpr v},'') config.cgnix.entries)}
|
2024-04-05 22:56:00 +02:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|