{ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixvim.url = "github:nix-community/nixvim"; }; outputs = { self, nixpkgs, nixvim, }: let pkgs = nixpkgs.legacyPackages.x86_64-linux; npkgs = nixvim.legacyPackages.x86_64-linux; in { packages.x86_64-linux.default = npkgs.makeNixvimWithModule { module = { config = { extraPackages = [ pkgs.alejandra pkgs.black pkgs.cargo pkgs.cmake-format pkgs.go pkgs.rustfmt pkgs.shfmt pkgs.yamlfmt ]; options = {mouse = "";}; colorschemes.kanagawa = { enable = true; transparent = true; }; plugins = { ledger.enable = true; lsp = { enable = true; servers = { bashls.enable = true; nixd.enable = true; ruff-lsp.enable = true; gopls.enable = true; }; }; rustaceanvim.enable = true; conform-nvim = { enable = true; formatAfterSave.lspFallback = false; formattersByFt = { cmake = ["cmake_format"]; go = ["gofmt"]; nix = ["alejandra"]; python = ["black"]; rust = ["rustfmt"]; yaml = ["yamlfmt"]; _ = ["shfmt"]; }; formatters.shfmt = { prepend_args = ["-i" "4" "-s"]; }; formatters.rustfmt = { prepend_args = ["--edition" "2021"]; }; }; luasnip.enable = true; nvim-cmp = { enable = true; snippet.expand = "luasnip"; autoEnableSources = true; sources = [ {name = "nvim_lsp";} {name = "path";} {name = "buffer";} ]; mapping = { "" = "cmp.mapping.confirm({ select = true })"; "" = { action = '' cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) else fallback() end end, {"i","s","c",}) ''; }; }; }; }; }; }; }; }; }