Skip to content

Commit

Permalink
feat: add runtimeDeps support
Browse files Browse the repository at this point in the history
  • Loading branch information
CnTeng committed Jan 19, 2025
1 parent e97c3c8 commit 07690ea
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion modules/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ let
taplo
libxml2
nodePackages.prettier
xxd
];
in
{
Expand Down Expand Up @@ -89,5 +88,7 @@ in
environment.systemPackages = [ cfg.finalPackage ] ++ languagesPkgs;

environment.variables.EDITOR = mkIf cfg.defaultEditor "nvim";

environment.pathsToLink = [ "/share/nvim" ];
};
}
9 changes: 6 additions & 3 deletions pkgs/rx-nvim/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
let
plugins = callPackage ./plugins.nix { };
configPath = ../../config;
inherit (plugins) pluginsPath extraLuaPackages;
inherit (plugins) pluginsPath runtimeDeps;

parsersPath = symlinkJoin {
name = "treesitter-parsers";
Expand All @@ -20,7 +20,6 @@ let
neovimConfig = neovimUtils.makeNeovimConfig {
autowrapRuntimeDeps = true;
plugins = [ vimPlugins.lazy-nvim ];
inherit extraLuaPackages;
luaRcContent = ''
vim.g.config_path = "${configPath}"
vim.g.plugins_path = "${pluginsPath}"
Expand All @@ -33,5 +32,9 @@ let
${extraConfig}
'';
};

nvim-wrapped = wrapNeovimUnstable neovim-unwrapped neovimConfig;
in
wrapNeovimUnstable neovim-unwrapped neovimConfig
nvim-wrapped.overrideAttrs (old: {
runtimeDeps = old.runtimeDeps ++ runtimeDeps;
})
19 changes: 9 additions & 10 deletions pkgs/rx-nvim/plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ let
in
if lib.isDerivation plugin then [ (mkEntry plugin) ] ++ dependencies else [ plugin ];

mkRuntimeDeps =
plugins:
let
op = acc: plugin: acc ++ plugin.runtimeDeps or [ ];
in
lib.foldl' op [ ] plugins;

plugins = with vimPlugins; [
# code
blink-cmp
Expand All @@ -39,10 +46,7 @@ let
kulala-nvim
lazydev-nvim
markdown-preview-nvim
{
name = "lspkind.nvim";
path = lspkind-nvim;
}
lspkind-nvim

# editor
ultimate-autopair-nvim
Expand Down Expand Up @@ -91,10 +95,5 @@ let
in
{
pluginsPath = linkFarm "lazy-plugins" (lib.concatMap mkLazyPlugin plugins);

extraLuaPackages =
p: with p; [
tiktoken_core
jsregexp
];
runtimeDeps = mkRuntimeDeps plugins;
}

0 comments on commit 07690ea

Please sign in to comment.