Installation
Prerequisites
- Nix with flakes enabled.
nixpkgs-unstable:npis developed againstnixpkgs-unstableand requires packages from it.- Basic knowledge of Nix and NixVim.
Quick Setup
-
Clone or add
npas a flake input in your project. -
Create
nix/nixvim.nixin your project:
{ np, ... }:
{
imports = [
np.nixvimModules.base
np.nixvimModules.presets.javascript
# Add more presets as needed
];
# Your overrides
}
-
In
flake.nix, build Neovim:[!IMPORTANT]
npis built onnixpkgs-unstableand requires its consumer to provide packages from it. Using a stable version ofnixpkgswill result in errors.{ inputs = { # np requires nixpkgs-unstable. nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixvim.url = "github:nix-community/nixvim"; np.url = "github:ar-at-localhost/np"; }; outputs = { self, nixpkgs, nixvim, np, ... }: let system = "x86_64-linux"; # adjust for your system # Use legacyPackages from nixpkgs-unstable. pkgs = nixpkgs.legacyPackages.${system}; in { devShells.${system}.default = pkgs.mkShell { packages = [ # Other development packages... # Make nixvim with our unstable pkgs and the project-specific module. (nixvim.legacyPackages.${system}.makeNixvimWithModule { inherit pkgs; module = ./nix/nixvim.nix; extraSpecialArgs = { inherit np; }; }) ]; }; }; } -
Enter the shell:
nix develop
For a quick preview of np: nix run .#np