# Copyright (c) 2023 BirdeeHub # Licensed under the MIT license { description = "A Lua-natic's neovim flake, with extra cats! nixCats!"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixCats.url = "github:BirdeeHub/nixCats-nvim"; neovim-nightly-overlay = { url = "github:nix-community/neovim-nightly-overlay"; }; plugins-nvim-emmet = { url = "github:olrtg/nvim-emmet"; flake = false; }; "plugins-cutlass.nvim" = { url = "github:gbprod/cutlass.nvim"; flake = false; }; "plugins-nerdy.nvim" = { url = "github:2kabhishek/nerdy.nvim"; flake = false; }; }; outputs = { self, nixpkgs, nixCats, ... } @ inputs: let inherit (nixCats) utils; luaPath = "${./.}"; forEachSystem = utils.eachSystem nixpkgs.lib.platforms.all; # import nixpkgs { config = extra_pkg_config; inherit system; } extra_pkg_config = { # allowUnfree = true; }; dependencyOverlays = [ (utils.sanitizedPluginOverlay inputs) ]; categoryDefinitions = { pkgs, settings, categories, extra, name, mkNvimPlugin, ... }: { lspsAndRuntimeDeps = with pkgs; let npm-modules = (import ./packages/npm-modules) { inherit pkgs; nodejs = pkgs.nodejs_20; }; in { general = [ (callPackage ./packages/erb-lint {}) alejandra bash-language-server biome curl docker-compose-language-service dockerfile-language-server-nodejs emmet-language-server fd fish-lsp gofumpt gopls gotools grpcurl hadolint helm-ls jq lazygit lua-language-server markdownlint-cli2 marksman nil nodePackages.prettier npm-modules.css-variables-language-server npm-modules.gh-actions-language-server npm-modules.markdown-toc nushell php84Packages.php-codesniffer php84Packages.php-cs-fixer phpactor pyright ripgrep rubocop ruby-lsp rubyPackages.erb-formatter ruff shellcheck shfmt sqlfluff stdenv.cc.cc stylelint stylelint-lsp stylua tailwindcss-language-server taplo terraform-ls tflint universal-ctags vscode-langservers-extracted vtsls vue-language-server yaml-language-server yamllint ]; }; startupPlugins = with pkgs.vimPlugins; with pkgs.neovimPlugins; { general = [ # LazyVim lazy-nvim LazyVim # Coding { plugin = mini-pairs; name = "mini.pairs"; } ts-comments-nvim { plugin = mini-ai; name = "mini.ai"; } lazydev-nvim # Colorscheme tokyonight-nvim { plugin = catppuccin-nvim; name = "catppuccin"; } # Editor grug-far-nvim flash-nvim which-key-nvim gitsigns-nvim trouble-nvim todo-comments-nvim # Formatting conform-nvim # Linting nvim-lint # LSP nvim-lspconfig # Treesitter nvim-treesitter.withAllGrammars nvim-treesitter-textobjects nvim-ts-autotag # UI bufferline-nvim lualine-nvim noice-nvim { plugin = mini-icons; name = "mini.icons"; } nui-nvim # Util snacks-nvim persistence-nvim plenary-nvim # Extras # Coding # Blink blink-cmp friendly-snippets # Luasnip { plugin = luasnip; name = "LuaSnip"; } # Mini-comment { plugin = mini-comment; name = "mini.comment"; } nvim-ts-context-commentstring # Mini-surround { plugin = mini-surround; name = "mini.surround"; } # Neogen neogen # yanky.nvim yanky-nvim # Editor # Aerial aerial-nvim # Dial dial-nvim # Navic nvim-navic # Neo-tree neo-tree-nvim # Refactoring refactoring-nvim # Lang # Go nvim-dap-go neotest-golang # Helm vim-helm # JSON & YAML SchemaStore-nvim # Markdown markdown-preview-nvim render-markdown-nvim # Python neotest-python # Ruby neotest-rspec # Sql vim-dadbod vim-dadbod-completion vim-dadbod-ui # Test # Neotest neotest nvim-nio # UI # Mini Animate { plugin = mini-animate; name = "mini.animate"; } # Treesitter-context nvim-treesitter-context # Util # Mini Hipatterns { plugin = mini-hipatterns; name = "mini.hipatterns"; } # Octo octo-nvim # Project project-nvim # Rest kulala-nvim # Custom cutlass-nvim diffview-nvim nerdy-nvim nvim-emmet rose-pine treesj vim-caddyfile ]; }; optionalPlugins = {}; # shared libraries to be added to LD_LIBRARY_PATH variable available to # nvim runtime sharedLibraries = { # general = with pkgs; [ # libgit2 # ]; }; environmentVariables = { # test = { # CATTESTVAR = "It worked!"; # }; }; extraWrapperArgs = { # test = [ # ''--set CATTESTVAR2 "It worked again!"'' # ]; }; extraPython3Packages = { test = [(_: [])]; }; # populates $LUA_PATH and $LUA_CPATH extraLuaPackages = { test = [(_: [])]; }; }; packageDefinitions = { nvim = { pkgs, mkNvimPlugin, ... }: { settings = { wrapRc = true; # aliases = [ "vim" ]; neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim; }; categories = { general = true; test = false; }; extra = {}; }; }; defaultPackageName = "nvim"; in forEachSystem (system: let # the builder function that makes it all work nixCatsBuilder = utils.baseBuilder luaPath { inherit nixpkgs system dependencyOverlays extra_pkg_config; } categoryDefinitions packageDefinitions; defaultPackage = nixCatsBuilder defaultPackageName; pkgs = import nixpkgs {inherit system;}; in { packages = utils.mkAllWithDefault defaultPackage; # Choose your package for devShell and add whatever else you want in it. devShells = { default = pkgs.mkShell { name = defaultPackageName; packages = [defaultPackage]; inputsFrom = []; shellHook = '' ''; }; }; }) // (let # We also export a nixos module to allow reconfiguration from # configuration.nix. nixosModule = utils.mkNixosModules { moduleNamespace = [defaultPackageName]; inherit defaultPackageName dependencyOverlays luaPath categoryDefinitions packageDefinitions extra_pkg_config nixpkgs ; }; # And the same for home manager. homeModule = utils.mkHomeModules { moduleNamespace = [defaultPackageName]; inherit defaultPackageName dependencyOverlays luaPath categoryDefinitions packageDefinitions extra_pkg_config nixpkgs ; }; in { overlays = utils.makeOverlays luaPath { inherit nixpkgs dependencyOverlays extra_pkg_config; } categoryDefinitions packageDefinitions defaultPackageName; nixosModules.default = nixosModule; homeModules.default = homeModule; inherit utils nixosModule homeModule; inherit (utils) templates; }); }