Initial commit: Nomarchy NixOS configuration
An opinionated NixOS configuration with Hyprland, featuring: - Modular flake-based architecture - Parameterized user configuration (username, timezone, locale, etc.) - Classical/antiquity theme with Thomas Cole wallpapers - Full Hyprland setup with waybar, rofi, swaync - Custom utility scripts (screenshots, screen recording, WiFi QR) - Neovim with LSP support - Interactive installer for existing NixOS systems - ISO builder for fresh installations Flake outputs: - nixosConfigurations.example - Test configuration - nixosConfigurations.installer - ISO installer - packages.iso - Bootable ISO image - apps.default - Interactive installer - lib.mkHost - Host builder function - templates.default - Starter template Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
156
modules/home/neovim.nix
Normal file
156
modules/home/neovim.nix
Normal file
@@ -0,0 +1,156 @@
|
||||
# Neovim configuration (basic setup - can be extended)
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
# LSP servers
|
||||
nil # Nix
|
||||
lua-language-server
|
||||
nodePackages.typescript-language-server
|
||||
nodePackages.vscode-langservers-extracted # HTML, CSS, JSON
|
||||
rust-analyzer
|
||||
zls # Zig
|
||||
gopls
|
||||
pyright
|
||||
marksman # Markdown
|
||||
taplo # TOML
|
||||
yaml-language-server
|
||||
ltex-ls # Grammar
|
||||
|
||||
# Formatters
|
||||
nixfmt
|
||||
stylua
|
||||
prettierd
|
||||
black
|
||||
rustfmt
|
||||
|
||||
# Tools
|
||||
ripgrep
|
||||
fd
|
||||
tree-sitter
|
||||
wl-clipboard
|
||||
];
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
# Core
|
||||
plenary-nvim
|
||||
nvim-web-devicons
|
||||
|
||||
# Fuzzy finder
|
||||
telescope-nvim
|
||||
|
||||
# Treesitter
|
||||
nvim-treesitter.withAllGrammars
|
||||
|
||||
# LSP
|
||||
nvim-lspconfig
|
||||
|
||||
# Completion
|
||||
nvim-cmp
|
||||
cmp-nvim-lsp
|
||||
cmp-buffer
|
||||
cmp-path
|
||||
luasnip
|
||||
cmp_luasnip
|
||||
|
||||
# UI
|
||||
lualine-nvim
|
||||
bufferline-nvim
|
||||
indent-blankline-nvim
|
||||
|
||||
# Git
|
||||
gitsigns-nvim
|
||||
|
||||
# File tree
|
||||
nvim-tree-lua
|
||||
|
||||
# Theme (can be customized to match nomarchy theme)
|
||||
tokyonight-nvim
|
||||
];
|
||||
|
||||
extraLuaConfig = /* backwards compat */ ''
|
||||
-- Basic settings
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.updatetime = 250
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
|
||||
-- Leader key
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Theme
|
||||
vim.cmd.colorscheme("tokyonight-night")
|
||||
|
||||
-- Telescope keymaps
|
||||
local telescope = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>ff", telescope.find_files, { desc = "Find files" })
|
||||
vim.keymap.set("n", "<leader>fg", telescope.live_grep, { desc = "Live grep" })
|
||||
vim.keymap.set("n", "<leader>fb", telescope.buffers, { desc = "Buffers" })
|
||||
|
||||
-- LSP setup
|
||||
local lspconfig = require("lspconfig")
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local servers = {
|
||||
"nil_ls", "lua_ls", "ts_ls", "html", "cssls", "jsonls",
|
||||
"rust_analyzer", "zls", "gopls", "pyright", "marksman",
|
||||
"taplo", "yamlls"
|
||||
}
|
||||
|
||||
for _, server in ipairs(servers) do
|
||||
lspconfig[server].setup({ capabilities = capabilities })
|
||||
end
|
||||
|
||||
-- Completion
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}),
|
||||
})
|
||||
|
||||
-- File tree
|
||||
require("nvim-tree").setup()
|
||||
vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", { silent = true })
|
||||
|
||||
-- Git signs
|
||||
require("gitsigns").setup()
|
||||
|
||||
-- Status line
|
||||
require("lualine").setup()
|
||||
|
||||
-- Buffer line
|
||||
require("bufferline").setup()
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user