nvim.nix/flake.nix
2025-02-02 22:38:46 -06:00

62 lines
1.4 KiB
Nix

{
description = "Neovim derivation";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
gen-luarc = {
url = "github:mrcjkb/nix-gen-luarc-json";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
flake-utils,
gen-luarc,
...
}: let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;};
in
flake-utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
neovim-overlay
gen-luarc.overlays.default
];
};
shell = pkgs.mkShell {
name = "nvim-devShell";
buildInputs = with pkgs; [
lua-language-server
nil
stylua
luajitPackages.luacheck
];
shellHook = ''
ln -fs ${pkgs.nvim-luarc-json} .luarc.json
'';
};
in {
packages = rec {
default = nvim;
nvim = pkgs.nvim-pkg;
nvim-min = pkgs.nvim-min-pkg;
};
devShells = {
default = shell;
};
})
// {
overlays.default = neovim-overlay;
};
}