mirror of
https://github.com/zoriya/flake.git
synced 2026-05-31 18:04:19 +00:00
Add nvim package output on the flake
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
};
|
||||
|
||||
mkSystem = import ./lib/mksystem.nix (inputs // {inherit overlays inputs;});
|
||||
eachSystem = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
|
||||
in {
|
||||
nixosConfigurations.fuhen = mkSystem "fuhen" {
|
||||
env = "river";
|
||||
@@ -100,5 +101,12 @@
|
||||
./modules/gui/ghostty.nix
|
||||
];
|
||||
};
|
||||
|
||||
packages = eachSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in rec {
|
||||
default = nvim;
|
||||
nvim = import ./nvim (inputs // { inherit pkgs; });
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
pkgs,
|
||||
neovim-nightly,
|
||||
...
|
||||
}: let
|
||||
mkNvim = pkgs.callPackage ./mknvim.nix {inherit pkgs;};
|
||||
in
|
||||
mkNvim {
|
||||
withNodeJs = false;
|
||||
withRuby = false;
|
||||
withPython3 = false;
|
||||
|
||||
package = neovim-nightly.packages.${pkgs.system}.default;
|
||||
|
||||
config = ./.;
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = lz-n;
|
||||
optional = false;
|
||||
}
|
||||
|
||||
# TODO: make grammars optional
|
||||
nvim-treesitter.withAllGrammars
|
||||
catppuccin-nvim
|
||||
];
|
||||
|
||||
lsp = with pkgs; [
|
||||
# see for helpers https://github.com/dundalek/lazy-lsp.nvim/blob/master/lua/lazy-lsp/servers.lua
|
||||
haskell-language-server
|
||||
rust-analyzer
|
||||
clang-tools
|
||||
omnisharp-roslyn
|
||||
pyright
|
||||
typescript-language-server
|
||||
nil
|
||||
gopls
|
||||
vscode-langservers-extracted # html, jsonls
|
||||
yaml-language-server
|
||||
marksman
|
||||
ltex-ls
|
||||
texlab
|
||||
helm-ls
|
||||
zls
|
||||
lua-language-server
|
||||
];
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
# Give access to gdbus for color-scheme detection (vim-lumen).
|
||||
glib
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
stdenv,
|
||||
...
|
||||
}: {
|
||||
package ? pkgs.neovim,
|
||||
config,
|
||||
plugins ? [],
|
||||
extraPackages ? [],
|
||||
lsp ? [],
|
||||
extraLuaPackages ? p: [],
|
||||
extraPython3Packages ? p: [],
|
||||
withPython3 ? false,
|
||||
withPerl ? false,
|
||||
withRuby ? false,
|
||||
withNodeJs ? false,
|
||||
withSqlite ? false,
|
||||
}: let
|
||||
# Stolen from pkgs.neovimUtils.normalizePlugins but this changes defaultPlugin.optional to true.
|
||||
normalizePlugins = plugins: let
|
||||
defaultPlugin = {
|
||||
plugin = null;
|
||||
config = null;
|
||||
optional = true;
|
||||
};
|
||||
in
|
||||
map (x:
|
||||
defaultPlugin
|
||||
// (
|
||||
if (x ? plugin)
|
||||
then x
|
||||
else {plugin = x;}
|
||||
))
|
||||
plugins;
|
||||
|
||||
externalPackages = extraPackages ++ lsp;
|
||||
in
|
||||
pkgs.wrapNeovimUnstable package {
|
||||
# maybe use true here?
|
||||
autoconfigure = false;
|
||||
autowrapRuntimeDeps = false;
|
||||
|
||||
plugins = normalizePlugins plugins;
|
||||
|
||||
wrapRc = false;
|
||||
wrapperArgs = builtins.concatStringsSep " " [
|
||||
(lib.optionals (externalPackages != []) ''--prefix PATH : "${lib.makeBinPath externalPackages}"'')
|
||||
];
|
||||
|
||||
inherit withPython3 withNodeJs withPerl withRuby extraPython3Packages extraLuaPackages;
|
||||
}
|
||||
Reference in New Issue
Block a user