mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 00:45:17 -06:00
91 lines
2.5 KiB
Nix
91 lines
2.5 KiB
Nix
{
|
|
description = "Neovim derivation";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/master";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
|
gen-luarc = {
|
|
url = "github:mrcjkb/nix-gen-luarc-json";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
dart = {
|
|
url = "github:iofq/dart.nvim";
|
|
flake = false;
|
|
};
|
|
nvim-treesitter = {
|
|
url = "github:nvim-treesitter/nvim-treesitter/main";
|
|
flake = false;
|
|
};
|
|
nvim-treesitter-textobjects = {
|
|
url = "github:nvim-treesitter/nvim-treesitter-textobjects/main";
|
|
flake = false;
|
|
};
|
|
# Add bleeding-edge plugins here.
|
|
# They can be updated with `nix flake update` (make sure to commit the generated flake.lock)
|
|
# wf-nvim = {
|
|
# url = "github:Cassin01/wf.nvim";
|
|
# flake = false;
|
|
# };
|
|
};
|
|
outputs =
|
|
inputs@{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
...
|
|
}:
|
|
let
|
|
systems = builtins.attrNames nixpkgs.legacyPackages;
|
|
|
|
# This is where the Neovim derivation is built.
|
|
neovim-overlay = import ./nix/neovim-overlay.nix { inherit inputs; };
|
|
in
|
|
flake-utils.lib.eachSystem systems (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
overlays = [
|
|
inputs.neovim-nightly-overlay.overlays.default
|
|
neovim-overlay
|
|
# This adds a function can be used to generate a .luarc.json
|
|
# containing the Neovim API all plugins in the workspace directory.
|
|
# The generated file can be symlinked in the devShell's shellHook.
|
|
inputs.gen-luarc.overlays.default
|
|
];
|
|
};
|
|
shell = pkgs.mkShell {
|
|
name = "nvim-devShell";
|
|
buildInputs = with pkgs; [
|
|
lua-language-server
|
|
nil
|
|
stylua
|
|
luajitPackages.luacheck
|
|
nvim-dev
|
|
];
|
|
shellHook = ''
|
|
# symlink the .luarc.json generated in the overlay
|
|
ln -fs ${pkgs.nvim-luarc-json} .luarc.json
|
|
# allow quick iteration of lua configs
|
|
ln -Tfns $PWD/nvim ~/.config/nvim-dev
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
packages = rec {
|
|
default = nvim;
|
|
nvim = pkgs.nvim-pkg;
|
|
nvim-min = pkgs.nvim-min-pkg;
|
|
nvim-dev = pkgs.nvim-dev;
|
|
};
|
|
devShells = {
|
|
default = shell;
|
|
};
|
|
}
|
|
)
|
|
// {
|
|
overlays.default = neovim-overlay;
|
|
};
|
|
}
|