nichts/modules/editors/nvf/default.nix

32 lines
731 B
Nix
Raw Normal View History

2024-07-06 15:15:37 +02:00
{
2024-07-06 15:53:16 +02:00
inputs,
lib,
...
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 15:15:37 +02:00
ingoredPaths ? [./nvf.nix],
}:
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 {
imports = concatLists [
# neovim-flake home-manager module
[nvf.homeManagerModules.default]
# 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
}