{ 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"; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; gen-luarc = { url = "github:mrcjkb/nix-gen-luarc-json"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = inputs @ { self, nixpkgs, flake-utils, gen-luarc, ... }: 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; overlays = [ inputs.neovim-nightly-overlay.overlays.default gen-luarc.overlays.default neovim-overlay ]; }; shell = pkgs.mkShell { name = "nvim-devShell"; buildInputs = with pkgs; [ lua-language-server nil stylua luajitPackages.luacheck nvim-dev ]; shellHook = '' 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; }; devShells = { default = shell; }; }) // { overlays.default = neovim-overlay; }; }