nix-community.nixvim/wrappers/standalone.nix
traxys b58b23c799
wrapper: Use symlink join to install man pages for standalone (#736)
Patching the derivation forces a rebuild of neovim, which is
undesirable
2023-11-23 22:11:29 +01:00

39 lines
940 B
Nix

default_pkgs: {
modules,
self,
}: {
pkgs ? default_pkgs,
extraSpecialArgs ? {},
module,
}: let
inherit (pkgs) lib;
wrap = {wrapRc = true;};
shared = import ./_shared.nix modules {
inherit pkgs lib;
config = {
_module.args = extraSpecialArgs;
};
};
eval = lib.evalModules {
modules = [module wrap] ++ shared.topLevelModules;
};
handleAssertions = config: let
failedAssertions = map (x: x.message) (lib.filter (x: !x.assertion) config.assertions);
in
if failedAssertions != []
then throw "\nFailed assertions:\n${builtins.concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"
else lib.showWarnings config.warnings config;
config = handleAssertions eval.config;
in
pkgs.symlinkJoin {
name = "nixvim";
paths =
[config.finalPackage]
++ pkgs.lib.optional config.enableMan self.packages.${pkgs.system}.man-docs;
meta.mainProgram = "nvim";
}