config/lib/mkNeovim.nix

31 lines
636 B
Nix
Raw Normal View History

2025-05-12 15:19:01 -07:00
{
nixpkgs,
# TODO: apply overlays here
overlays,
inputs,
}:
2025-06-07 13:56:21 -07:00
configPath: system:
2025-05-12 15:19:01 -07:00
let
darwin = nixpkgs.lib.strings.hasSuffix "-darwin" system;
2025-06-07 13:56:21 -07:00
user = builtins.elemAt (builtins.split "/" configPath) 0;
2025-05-12 15:19:01 -07:00
host = {
inherit darwin;
linux = !darwin;
};
userDir = ../users + "/${user}";
userConfig = import (userDir + "/user.nix");
in
(inputs.nvf.lib.neovimConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = builtins.filter (f: f != null) [
2025-06-07 13:56:21 -07:00
(../users + ("/" + configPath + "/vim.nix"))
2025-05-12 15:19:01 -07:00
../modules/neovim
];
extraSpecialArgs = {
inherit host;
user = userConfig;
};
}).neovim