nichts/modules/editors/nvf/default.nix

33 lines
763 B
Nix
Raw Normal View History

2024-07-06 15:15:37 +02:00
{
2024-07-06 17:14:45 +02:00
config,
2024-07-06 15:53:16 +02:00
lib,
2024-07-06 17:14:45 +02:00
inputs,
2024-07-06 15:53:16 +02:00
...
2024-07-06 15:15:37 +02:00
}: let
inherit (builtins) filter map toString elem;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix;
2024-07-06 15:53:16 +02:00
inherit (lib.lists) concatLists;
2024-07-06 15:15:37 +02:00
2024-07-06 15:53:16 +02:00
mkNeovimModule = {
path,
2024-07-06 17:14:45 +02:00
ingoredPaths ? [./nvf.nix ./plugins/sources/default.nix],
2024-07-06 15:15:37 +02:00
}:
filter (hasSuffix ".nix") (
map toString (
filter (path: path != ./default.nix && !elem path ingoredPaths) (listFilesRecursive path)
2024-07-06 15:53:16 +02:00
)
);
2024-07-06 15:15:37 +02:00
nvf = inputs.neovim-flake;
in {
2024-07-06 17:14:45 +02:00
imports = concatLists [
2024-07-06 15:15:37 +02:00
# neovim-flake home-manager module
2024-07-06 17:14:45 +02:00
[nvf.nixosModules.default]
2024-07-06 15:15:37 +02:00
# construct this entore directory as a module
# which means all default.nix files will be imported automtically
(mkNeovimModule {path = ./.;})
];
2024-07-06 15:53:16 +02:00
}