2024-07-02 13:30:29 +01:00
|
|
|
helpers:
|
|
|
|
{ lib, config, ... }:
|
2024-05-05 19:39:35 +02:00
|
|
|
let
|
2024-07-02 13:30:29 +01:00
|
|
|
inherit (lib) mkOption mkOptionType;
|
|
|
|
cfg = config.programs.nixvim;
|
2024-05-05 19:39:35 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
topLevelModules = [
|
2024-07-02 13:30:29 +01:00
|
|
|
../modules
|
2024-05-05 19:39:35 +02:00
|
|
|
./modules/output.nix
|
2024-07-02 13:30:29 +01:00
|
|
|
./modules/files.nix
|
|
|
|
];
|
2023-04-20 22:41:37 +02:00
|
|
|
|
2023-01-24 01:28:01 +00:00
|
|
|
helpers = mkOption {
|
|
|
|
type = mkOptionType {
|
|
|
|
name = "helpers";
|
|
|
|
description = "Helpers that can be used when writing nixvim configs";
|
|
|
|
check = builtins.isAttrs;
|
|
|
|
};
|
|
|
|
description = "Use this option to access the helpers";
|
2024-02-07 16:50:08 +01:00
|
|
|
default = helpers;
|
2023-01-24 01:28:01 +00:00
|
|
|
};
|
2023-04-20 22:41:37 +02:00
|
|
|
|
2024-05-05 19:39:35 +02:00
|
|
|
configFiles =
|
|
|
|
(lib.mapAttrs' (_: file: lib.nameValuePair "nvim/${file.path}" { text = file.content; }) cfg.files)
|
|
|
|
// (lib.mapAttrs' (
|
|
|
|
path: content: lib.nameValuePair "nvim/${path}" { text = content; }
|
|
|
|
) cfg.extraFiles);
|
2023-01-24 01:28:01 +00:00
|
|
|
}
|