mirror of
https://github.com/MagicBOTAlex/nixos-server.git
synced 2025-09-04 21:06:52 +02:00
neovim
This commit is contained in:
commit
f358915432
6 changed files with 465 additions and 0 deletions
106
modules/nvim.nix
Normal file
106
modules/nvim.nix
Normal file
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
build-dependent-pkgs = with pkgs; [
|
||||
acl
|
||||
attr
|
||||
bzip2
|
||||
curl
|
||||
libsodium
|
||||
libssh
|
||||
libxml2
|
||||
openssl
|
||||
stdenv.cc.cc
|
||||
systemd
|
||||
util-linux
|
||||
xz
|
||||
zlib
|
||||
zstd
|
||||
glib
|
||||
libcxx
|
||||
];
|
||||
|
||||
makePkgConfigPath = x: makeSearchPathOutput "dev" "lib/pkgconfig" x;
|
||||
makeIncludePath = x: makeSearchPathOutput "dev" "include" x;
|
||||
|
||||
nvim-depends-library = pkgs.buildEnv {
|
||||
name = "nvim-depends-library";
|
||||
paths = map lib.getLib build-dependent-pkgs;
|
||||
extraPrefix = "/lib/nvim-depends";
|
||||
pathsToLink = [ "/lib" ];
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
nvim-depends-include = pkgs.buildEnv {
|
||||
name = "nvim-depends-include";
|
||||
paths = splitString ":" (makeIncludePath build-dependent-pkgs);
|
||||
extraPrefix = "/lib/nvim-depends/include";
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
nvim-depends-pkgconfig = pkgs.buildEnv {
|
||||
name = "nvim-depends-pkgconfig";
|
||||
paths = splitString ":" (makePkgConfigPath build-dependent-pkgs);
|
||||
extraPrefix = "/lib/nvim-depends/pkgconfig";
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
buildEnv = [
|
||||
"CPATH=${config.home.profileDirectory}/lib/nvim-depends/include"
|
||||
"CPLUS_INCLUDE_PATH=${config.home.profileDirectory}/lib/nvim-depends/include/c++/v1"
|
||||
"LD_LIBRARY_PATH=${config.home.profileDirectory}/lib/nvim-depends/lib"
|
||||
"LIBRARY_PATH=${config.home.profileDirectory}/lib/nvim-depends/lib"
|
||||
"NIX_LD_LIBRARY_PATH=${config.home.profileDirectory}/lib/nvim-depends/lib"
|
||||
"PKG_CONFIG_PATH=${config.home.profileDirectory}/lib/nvim-depends/pkgconfig"
|
||||
];
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
patchelf
|
||||
nvim-depends-include
|
||||
nvim-depends-library
|
||||
nvim-depends-pkgconfig
|
||||
ripgrep
|
||||
];
|
||||
home.extraOutputsToInstall = ["nvim-depends"];
|
||||
home.shellAliases.nvim =
|
||||
(concatStringsSep " " buildEnv)
|
||||
+ " SQLITE_CLIB_PATH=${pkgs.sqlite.out}/lib/libsqlite3.so "
|
||||
+ "nvim";
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
package = pkgs.neovim-unwrapped;
|
||||
|
||||
withNodeJs = true;
|
||||
withPython3 = true;
|
||||
withRuby = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
doq
|
||||
sqlite
|
||||
cargo
|
||||
clang
|
||||
cmake
|
||||
gcc
|
||||
gnumake
|
||||
ninja
|
||||
pkg-config
|
||||
yarn
|
||||
texlivePackages.latex
|
||||
tree-sitter
|
||||
];
|
||||
|
||||
extraLuaPackages = ls: with ls; [ luarocks ];
|
||||
};
|
||||
|
||||
xdg.configFile."nvim".source = pkgs.fetchFromGitHub {
|
||||
owner = "MagicBOTAlex";
|
||||
repo = "NVimConfigs";
|
||||
rev = "2927ce8e62e47b0b542ae18623cb6dbee6c32add";
|
||||
hash = "sha256-f45NJYaiBLAQ9RmjzEPzI6LBrlj/vdA+ONkdRAzAIjQ=";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue