Init:start-nix

This commit is contained in:
dichgrem
2025-07-22 12:18:15 +08:00
parent 7ce7214a74
commit e57cdd246c
178 changed files with 22667 additions and 1 deletions

View File

@@ -0,0 +1,44 @@
{pkgs, ...}: {
programs.nixvim = {
extraPackages = with pkgs; [
stylua
];
plugins.conform-nvim = {
enable = true;
settings = {
notify_on_error = false;
format_on_save = ''
function(bufnr)
-- Disable "format_on_save lsp_fallback" for lanuages that don't
-- have a well standardized coding style. You can add additional
-- lanuages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype]
}
end
'';
formatters_by_ft = {
lua = ["stylua"];
};
};
};
keymaps = [
{
mode = "";
key = "<leader>f";
action.__raw = ''
function()
require('conform').format { async = true, lsp_fallback = true }
end
'';
options = {
desc = "[F]ormat buffer";
};
}
];
};
}