Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

This flake provides a bleeding edge LazyVim home-manager module, allowing you to install and configure LazyVim declaratively on NixOS. It tracks LazyVim releases automatically, and uses the latest plugin versions at the time of a LazyVim release.

License

Notifications You must be signed in to change notification settings

pfassina/lazyvim-nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

126 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

lazyvim-nix

A bleeding edge Nix flake for LazyVim that automatically tracks LazyVim releases and provides zero-configuration setup for NixOS and home-manager users.

πŸš€ Always up-to-date: Automatically tracks LazyVim releases and uses the latest plugin versions at the time of each LazyVim release.

Documentation

Quick Start

Add to your flake inputs:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    home-manager.url = "github:nix-community/home-manager";
    lazyvim.url = "github:pfassina/lazyvim-nix";
  };

  outputs = { nixpkgs, home-manager, lazyvim, ... }: {
    # Your system configuration
  };
}

Enable in your home-manager configuration:

{
  imports = [ lazyvim.homeManagerModules.default ];
  programs.lazyvim.enable = true;
}

That's it! Open nvim and enjoy LazyVim.

Version Pinning

Pin to a specific LazyVim release:

lazyvim.url = "github:pfassina/lazyvim-nix/v15.13.0";  # Pin to v15.13.0

Basic Configuration

Language Support

programs.lazyvim = {
  enable = true;

  extras = {
    lang.nix.enable = true;
    lang.python = {
      enable = true;
      installDependencies = true;        # Install ruff
      installRuntimeDependencies = true; # Install python3
    };
    lang.go = {
      enable = true;
      installDependencies = true;        # Install gopls, gofumpt, etc.
      installRuntimeDependencies = true; # Install go compiler
    };
  };

  # Additional packages (optional)
  extraPackages = with pkgs; [
    nixd       # Nix LSP
    alejandra  # Nix formatter
  ];

  # Only needed for languages not covered by LazyVim extras
  treesitterParsers = with pkgs.vimPlugins.nvim-treesitter-parsers; [
    wgsl      # WebGPU Shading Language
    templ     # Go templ files
  ];
};

Note: Treesitter grammars are installed automatically based on enabled language extras.

Dependency Control

Control which packages get installed automatically:

programs.lazyvim = {
  enable = true;

  # Core LazyVim dependencies (git, ripgrep, fd, etc.)
  installCoreDependencies = true;  # default: true

  extras = {
    lang.typescript = {
      enable = true;
      installDependencies = false;        # Skip typescript tools
      installRuntimeDependencies = true;  # But install nodejs
    };
  };
};

Note: Dependencies are opt-in per language. Set to false to manage packages manually via extraPackages.

⚠️ Experimental: Automatic dependency installation is experimental and might not cover all required packages. Use extraPackages for missing dependencies.

Custom Configuration

Option 1: Inline Configuration

programs.lazyvim = {
  enable = true;

  config = {
    options = ''
      vim.opt.relativenumber = false
      vim.opt.wrap = true
    '';

    keymaps = ''
      vim.keymap.set("n", "<leader>w", "<cmd>w<cr>", { desc = "Save" })
    '';
  };

  plugins = {
    colorscheme = ''
      return {
        "catppuccin/nvim",
        opts = { flavour = "mocha" },
      }
    '';
  };
};

Option 2: File-based Configuration

For larger configurations, you can organize your LazyVim config files in a directory:

programs.lazyvim = {
  enable = true;
  configFiles = ./my-lazyvim-config;
};

Directory structure:

my-lazyvim-config/
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ keymaps.lua
β”‚   β”œβ”€β”€ options.lua
β”‚   └── autocmds.lua
└── plugins/
    β”œβ”€β”€ colorscheme.lua
    β”œβ”€β”€ lsp-config.lua
    └── editor.lua

Note: You can mix configFiles with inline config and plugins options, but you cannot configure the same file in both places. For example, if configFiles contains config/keymaps.lua, you cannot also set config.keymaps.

Key Features

  • πŸš€ Always up-to-date - Automatically tracks LazyVim releases with latest plugin versions
  • βœ… Zero-configuration setup - Just enable and go
  • πŸ€– Reproducible builds - Core and Extra LazyVim plugins locked and in dev mode.

Documentation

πŸ“– Getting Started - Complete setup guide

βš™οΈ Configuration Reference - Module options and configuration

🎯 LazyVim Extras - Language and feature support

πŸ”§ Plugin Sourcing Strategy - How plugins are resolved and managed

🚨 Troubleshooting - Common issues and solutions

Updating

nix flake update          # Update to latest LazyVim
home-manager switch       # Apply changes

Acknowledgments

License

MIT

About

This flake provides a bleeding edge LazyVim home-manager module, allowing you to install and configure LazyVim declaratively on NixOS. It tracks LazyVim releases automatically, and uses the latest plugin versions at the time of a LazyVim release.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 7