nichts/modules/editors/nvf/default.nix

37 lines
843 B
Nix
Raw Normal View History

2024-07-10 23:10:52 +02:00
# credits to raf, his repo is in the README.md!
2024-07-06 15:15:37 +02:00
{
2024-07-07 23:45:18 +02:00
pkgs,
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-08 00:13:37 +02:00
ignoredPaths ? [],
2024-07-06 15:15:37 +02:00
}:
filter (hasSuffix ".nix") (
map toString (
2024-07-07 23:45:18 +02:00
filter (path: path != ./default.nix && !elem path ignoredPaths) (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-07 23:45:18 +02:00
environment.systemPackages = with pkgs; [
typstyle
];
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-10 23:10:52 +02:00
# construct this entire directory as a module
2024-07-06 15:15:37 +02:00
# which means all default.nix files will be imported automtically
(mkNeovimModule {path = ./.;})
];
2024-07-06 15:53:16 +02:00
}