2023-01-24 01:28:01 +00:00
|
|
|
{ modules, helpers }:
|
2024-02-07 16:50:08 +01:00
|
|
|
{
|
2023-02-20 11:42:13 +01:00
|
|
|
lib,
|
|
|
|
pkgs,
|
2023-04-20 22:41:37 +02:00
|
|
|
config,
|
2023-02-20 11:42:13 +01:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (lib)
|
|
|
|
mkEnableOption
|
|
|
|
mkOption
|
|
|
|
mkOptionType
|
|
|
|
mkForce
|
|
|
|
mkMerge
|
|
|
|
mkIf
|
|
|
|
types
|
|
|
|
;
|
|
|
|
in
|
|
|
|
{
|
2023-04-20 22:41:37 +02:00
|
|
|
topLevelModules = [
|
|
|
|
./modules/output.nix
|
|
|
|
(import ./modules/files.nix (modules pkgs))
|
|
|
|
] ++ (modules pkgs);
|
|
|
|
|
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
|
|
|
|
|
|
|
configFiles =
|
|
|
|
let
|
|
|
|
cfg = config.programs.nixvim;
|
|
|
|
in
|
2023-04-21 20:04:58 +02:00
|
|
|
(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
|
|
|
}
|