#W# Initial Commit: NixOS
This commit is contained in:
commit
f79adc1a63
77 changed files with 15125 additions and 0 deletions
9
home-manager/modules/nvim/default.nix
Executable file
9
home-manager/modules/nvim/default.nix
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, pkgs, ... }: {
|
||||
imports = [
|
||||
./options.nix
|
||||
./plugins.nix
|
||||
./keymaps.nix
|
||||
./init.nix
|
||||
./neovim.nix
|
||||
];
|
||||
}
|
||||
7
home-manager/modules/nvim/init.nix
Normal file
7
home-manager/modules/nvim/init.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, ... }: {
|
||||
xdg.configFile."nvim/init.lua".text = ''
|
||||
require("options")
|
||||
require("keymaps")
|
||||
require("plugins")
|
||||
'';
|
||||
}
|
||||
23
home-manager/modules/nvim/keymaps.nix
Executable file
23
home-manager/modules/nvim/keymaps.nix
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
{ ... }: {
|
||||
xdg.configFile."nvim/lua/keymaps.lua".text = ''
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
local keymap = vim.keymap.set
|
||||
keymap('n', '<leader>ps', ':Lazy<CR>')
|
||||
keymap('n', '<leader>o', ':update<CR> :source<CR>')
|
||||
keymap('n', '<leader>w', ':write<CR>')
|
||||
keymap('n', '<leader>q', ':quit<CR>')
|
||||
keymap('n', '<leader>QQ', ':q!<CR>')
|
||||
keymap('n', '<leader>wq', ':wq<CR>')
|
||||
keymap('n', '<leader>r', ':set wrap!<CR>')
|
||||
keymap('n', '<leader>vs', ':vsplit<CR>')
|
||||
keymap('n', '<leader>hs', ':split<CR>')
|
||||
keymap('n', '<Tab>', ':bnext<CR>')
|
||||
keymap('n', '<leader>e', ':Oil --float<CR>')
|
||||
keymap('n', '<leader>b', ':Telescope buffers<CR>')
|
||||
keymap('n', '<leader>ff', ':Telescope find_files<CR>')
|
||||
keymap('n', '<leader>fg', ':Telescope live_grep<CR>')
|
||||
keymap('n', '<leader>n', ':set nonumber norelativenumber<CR>')
|
||||
'';
|
||||
}
|
||||
18
home-manager/modules/nvim/neovim.nix
Executable file
18
home-manager/modules/nvim/neovim.nix
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, ... }: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
extraPackages = with pkgs; [
|
||||
lua-language-server
|
||||
nil
|
||||
gcc
|
||||
gnumake
|
||||
unzip
|
||||
wget
|
||||
curl
|
||||
ripgrep
|
||||
fd
|
||||
lua-language-server
|
||||
];
|
||||
};
|
||||
}
|
||||
22
home-manager/modules/nvim/options.nix
Executable file
22
home-manager/modules/nvim/options.nix
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
{ ... }: {
|
||||
xdg.configFile."nvim/lua/options.lua".text = ''
|
||||
local opt = vim.opt
|
||||
opt.showmode = false
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
opt.tabstop = 4
|
||||
opt.shiftwidth = 4
|
||||
opt.expandtab = true
|
||||
opt.autoindent = true
|
||||
opt.smartindent = true
|
||||
opt.termguicolors = true
|
||||
opt.background = "dark"
|
||||
opt.signcolumn = "yes"
|
||||
opt.cursorline = true
|
||||
opt.listchars = "tab: ,multispace:| ,eol:"
|
||||
opt.list = true
|
||||
opt.winborder = "rounded"
|
||||
opt.backspace = "indent,eol,start"
|
||||
opt.clipboard:append("unnamedplus")
|
||||
'';
|
||||
}
|
||||
135
home-manager/modules/nvim/plugins.nix
Executable file
135
home-manager/modules/nvim/plugins.nix
Executable file
|
|
@ -0,0 +1,135 @@
|
|||
{ pkgs, ... }: {
|
||||
xdg.configFile."nvim/lua/plugins.lua".text = ''
|
||||
-- 1. Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- 2. Setup Plugins
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- Colorschemes
|
||||
{ "RomanAverin/charleston.nvim", priority = 1000 },
|
||||
|
||||
-- Status line
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'charleston', -- It should pick up your theme automatically
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
globalstatus = true, -- Nice modern single bar at the bottom
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
-- Completion & UI
|
||||
{
|
||||
'saghen/blink.cmp',
|
||||
dependencies = 'rafamadriz/friendly-snippets',
|
||||
version = '*',
|
||||
opts = {
|
||||
keymap = { preset = 'default' },
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
}
|
||||
},
|
||||
-- LSP Configuration (Updated for Neovim 0.11+)
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = { 'saghen/blink.cmp' },
|
||||
config = function()
|
||||
-- In Neovim 0.11, we use the native vim.lsp.config API
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
|
||||
-- List the servers you want to enable
|
||||
local servers = { "lua_ls", "nil_ls" }
|
||||
|
||||
for _, server in ipairs(servers) do
|
||||
vim.lsp.config(server, {
|
||||
install = {
|
||||
-- This prevents lspconfig from trying to install things
|
||||
-- since Nix is handling the binaries
|
||||
enabled = false,
|
||||
},
|
||||
capabilities = capabilities,
|
||||
})
|
||||
-- Enable the server
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
end
|
||||
},
|
||||
|
||||
-- Navigation & Files
|
||||
{ "stevearc/oil.nvim", opts = { default_file_explorer = true } },
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" }
|
||||
},
|
||||
|
||||
-- Dashboard Configuration
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
local dashboard = require("dashboard")
|
||||
dashboard.setup({
|
||||
theme = "doom",
|
||||
config = {
|
||||
header = {
|
||||
" ",
|
||||
" ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗",
|
||||
" ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║",
|
||||
" ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║",
|
||||
" ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║",
|
||||
" ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║",
|
||||
" ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝",
|
||||
" ",
|
||||
},
|
||||
center = {
|
||||
{ icon = " ", icon_hl = "@variable", desc = "New File", key = "n", action = "enew" },
|
||||
{ icon = " ", icon_hl = "@variable", desc = "File Explorer", key = "e", action = "Oil --float" },
|
||||
{ icon = " ", icon_hl = "@variable", desc = "Find File", key = "f", action = "Telescope find_files" },
|
||||
{ icon = " ", icon_hl = "@variable", desc = "Find Text", key = "t", action = "Telescope live_grep" },
|
||||
{ icon = " ", icon_hl = "@variable", desc = "Quit", key = "q", action = "qa" },
|
||||
},
|
||||
footer = { "v" .. vim.version().major .. "." .. vim.version().minor },
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
},
|
||||
install = { colorscheme = { "charleston" } },
|
||||
checker = { enabled = true }, -- automatically check for plugin updates
|
||||
})
|
||||
|
||||
-- Final Theme Load
|
||||
vim.cmd("colorscheme charleston")
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue