Skip to content

Commit

Permalink
neovim: use more functions from neovimUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
adomixaszvers committed Jan 14, 2025
1 parent 524d42f commit 6e5196d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
12 changes: 6 additions & 6 deletions profiles/cli/neovim/customRc.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# vim
# lua
''
luafile ${./nvim-treesitter.lua}
luafile ${./lspconfig.lua}
luafile ${./cmp.lua}
luafile ${./playground.lua}
luafile ${./init.lua}
dofile '${./nvim-treesitter.lua}'
dofile '${./lspconfig.lua}'
dofile '${./cmp.lua}'
dofile '${./playground.lua}'
dofile '${./init.lua}'
''
2 changes: 1 addition & 1 deletion profiles/cli/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
enable = true;
package = pkgs.neovim-unwrapped;
plugins = import ./plugins.nix pkgs;
extraConfig = import ./customRc.nix;
extraLuaConfig = import ./customRc.nix;
extraPackages = with pkgs; [ lua-language-server ];
};
}
12 changes: 5 additions & 7 deletions profiles/cli/neovim/nvim-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ let
which-key-nvim
]
++ telescope-dependencies;
normalizedPlugins = neovimUtils.normalizePlugins plugins;
moduleConfigure = {
packages.neovim-nix = {
start = plugins;
opt = [ ];
};
packages.neovim-nix = neovimUtils.normalizedPluginsToVimPackage normalizedPlugins;
beforePlugins = "";
};

Expand All @@ -62,10 +60,10 @@ let
withNode = false;
withRuby = false;
configure = moduleConfigure;
customRC = # vim
luaRcContent = # lua
''
luafile ${./nvim-treesitter.lua}
luafile ${./init.lua}
dofile '${./nvim-treesitter.lua}'
dofile '${./init.lua}'
'';
};
extraWrapperArgs =
Expand Down
12 changes: 3 additions & 9 deletions profiles/cli/neovim/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,16 @@
}:
let
plugins = import ./plugins.nix pkgs;
normalizedPlugins = neovimUtils.normalizePlugins plugins;
moduleConfigure = {
packages.home-manager =
let
ps = builtins.partition (x: x.optional or false) (map (x: x.plugin or x) plugins);
in
{
start = ps.wrong;
opt = ps.right;
};
packages.home-manager = neovimUtils.normalizedPluginsToVimPackage normalizedPlugins;
beforePlugins = "";
};

neovimConfig = neovimUtils.makeNeovimConfig {
inherit plugins;
configure = moduleConfigure;
customRC = import ./customRc.nix;
luaRcContent = import ./customRc.nix;
};
in
wrapNeovimUnstable neovim-unwrapped neovimConfig

0 comments on commit 6e5196d

Please sign in to comment.