diff --git a/modules/home-manager/common/all-cli.nix b/modules/home-manager/common/all-cli.nix index e179ac2..0a164df 100644 --- a/modules/home-manager/common/all-cli.nix +++ b/modules/home-manager/common/all-cli.nix @@ -1,20 +1,29 @@ { pkgs, genebean-omp-themes, ... }: { home.packages = with pkgs; [ + cargo colordiff dogdns dos2unix du-dust + fd git-filter-repo gotop htop hub jq + lazygit + lua-language-server minicom mtr + nil nix-zsh-completions + nodejs + nodePackages.npm nurl powershell + puppet-lint rename + ruby subversion tree trippy @@ -78,15 +87,43 @@ }; }; # end git jq.enable = true; - neovim.enable = true; + neovim = { + enable = true; + defaultEditor = false; + extraLuaConfig = '' + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + vim.opt.rtp:prepend(lazypath) + + require("config.keymaps") + require("lazy").setup("plugins") + ''; + extraPackages = [ pkgs.gcc ]; # needed so treesitter can do compiling + plugins = [ pkgs.vimPlugins.lazy-nvim ]; # let lazy.nvim manage every other plugin + }; oh-my-posh = { enable = true; enableZshIntegration = true; settings = builtins.fromJSON (builtins.unsafeDiscardStringContext (builtins.readFile (genebean-omp-themes + "/beanbag.omp.json"))); }; + ripgrep.enable = true; tmux = { enable = true; historyLimit = 100000; + tmuxinator.enable = true; + plugins = with pkgs.tmuxPlugins; [ + vim-tmux-navigator + { + plugin = dracula; + extraConfig = '' + set -g @dracula-show-battery false + set -g @dracula-show-powerline true + set -g @dracula-refresh-rate 10 + ''; + } + ]; + extraConfig = '' + set -g status-position top + ''; }; vim = { enable = true; @@ -107,6 +144,7 @@ vim-ruby vim-snipmate vim-snippets + vim-tmux-navigator vim-yaml ]; settings = { @@ -213,6 +251,10 @@ }; # end programs home.file = { + ".config/nvim/lua" = { + source = ../files/nvim/lua; + recursive = true; + }; ".config/powershell/Microsoft.PowerShell_profile.ps1".source = ../files/Microsoft.PowerShell_profile.ps1; ".config/powershell/Microsoft.VSCode_profile.ps1".source = ../files/Microsoft.PowerShell_profile.ps1; }; diff --git a/modules/home-manager/files/nvim/lua/config/keymaps.lua b/modules/home-manager/files/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..2d096b8 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/config/keymaps.lua @@ -0,0 +1,11 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- use spaces for tabs and whatnot +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.shiftround = true + +vim.keymap.set('n', 'h', ':nohlsearch') diff --git a/modules/home-manager/files/nvim/lua/disabled/barbar.lua b/modules/home-manager/files/nvim/lua/disabled/barbar.lua new file mode 100644 index 0000000..b3d6668 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/disabled/barbar.lua @@ -0,0 +1,14 @@ +return {'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, + init = function() vim.g.barbar_auto_setup = false end, + opts = { + -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + -- animation = true, + -- insert_at_start = true, + -- …etc. + }, +} + diff --git a/modules/home-manager/files/nvim/lua/disabled/bufferline.lua b/modules/home-manager/files/nvim/lua/disabled/bufferline.lua new file mode 100644 index 0000000..eff1628 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/disabled/bufferline.lua @@ -0,0 +1,7 @@ +return{ + "akinsho/bufferline.nvim", + version = "*", + dependencies = "nvim-tree/nvim-web-devicons", + event = "BufReadPre", + config = true +} diff --git a/modules/home-manager/files/nvim/lua/disabled/nvim-tree.lua b/modules/home-manager/files/nvim/lua/disabled/nvim-tree.lua new file mode 100644 index 0000000..fd61629 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/disabled/nvim-tree.lua @@ -0,0 +1,11 @@ +return{ + "nvim-tree/nvim-tree.lua", + config = function () + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + require('nvim-tree').setup() + + vim.keymap.set('n', '', ':NvimTreeFindFileToggle') + end +} \ No newline at end of file diff --git a/modules/home-manager/files/nvim/lua/disabled/themes/catppuccin.lua b/modules/home-manager/files/nvim/lua/disabled/themes/catppuccin.lua new file mode 100644 index 0000000..124a53e --- /dev/null +++ b/modules/home-manager/files/nvim/lua/disabled/themes/catppuccin.lua @@ -0,0 +1,10 @@ +return { + "catppuccin/nvim", + name = "catppuccin", + flavour = "frappe", -- latte, frappe, macchiato, mocha + lazy = false, + priority = 1000, + config = function() + vim.cmd.colorscheme "catppuccin" + end, +} diff --git a/modules/home-manager/files/nvim/lua/disabled/themes/gruvbox.lua b/modules/home-manager/files/nvim/lua/disabled/themes/gruvbox.lua new file mode 100644 index 0000000..5959325 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/disabled/themes/gruvbox.lua @@ -0,0 +1,11 @@ +return { + "ellisonleao/gruvbox.nvim", + priority = 1000 , + config = function () + require("gruvbox").setup() + + vim.o.background = "dark" + vim.o.termguicolors = true + vim.cmd.colorscheme "gruvbox" + end +} diff --git a/modules/home-manager/files/nvim/lua/disabled/themes/kanagawa.lua b/modules/home-manager/files/nvim/lua/disabled/themes/kanagawa.lua new file mode 100644 index 0000000..9bb8090 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/disabled/themes/kanagawa.lua @@ -0,0 +1,8 @@ +return { + "rebelot/kanagawa.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd.colorscheme "kanagawa" + end, +} diff --git a/modules/home-manager/files/nvim/lua/disabled/themes/oxocarbon.lua b/modules/home-manager/files/nvim/lua/disabled/themes/oxocarbon.lua new file mode 100644 index 0000000..9249ddd --- /dev/null +++ b/modules/home-manager/files/nvim/lua/disabled/themes/oxocarbon.lua @@ -0,0 +1,8 @@ +return { + "nyoom-engineering/oxocarbon.nvim", + config = function () + vim.o.background = "dark" + vim.o.termguicolors = true + vim.cmd.colorscheme "oxocarbon" + end +} diff --git a/modules/home-manager/files/nvim/lua/disabled/themes/tokyonight.lua b/modules/home-manager/files/nvim/lua/disabled/themes/tokyonight.lua new file mode 100644 index 0000000..d12df83 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/disabled/themes/tokyonight.lua @@ -0,0 +1,10 @@ +return { + -- the colorscheme should be available when starting Neovim + "folke/tokyonight.nvim", + lazy = false, -- make sure we load this during startup if it is your main colorscheme + priority = 1000, -- make sure to load this before all the other start plugins + config = function() + -- load the colorscheme here + vim.cmd.colorscheme "tokyonight-storm" + end, +} \ No newline at end of file diff --git a/modules/home-manager/files/nvim/lua/plugins/cheatsheet.lua b/modules/home-manager/files/nvim/lua/plugins/cheatsheet.lua new file mode 100644 index 0000000..e478932 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/cheatsheet.lua @@ -0,0 +1,9 @@ +return { + "sudormrfbin/cheatsheet.nvim", + dependencies = { + 'nvim-telescope/telescope.nvim', + 'nvim-lua/popup.nvim', + 'nvim-lua/plenary.nvim', + }, + config = true, +} diff --git a/modules/home-manager/files/nvim/lua/plugins/dracula.lua b/modules/home-manager/files/nvim/lua/plugins/dracula.lua new file mode 100644 index 0000000..4634bbf --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/dracula.lua @@ -0,0 +1,8 @@ +return { + "Mofiqul/dracula.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd.colorscheme "dracula" + end, +} diff --git a/modules/home-manager/files/nvim/lua/plugins/lualine.lua b/modules/home-manager/files/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..bbf0077 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/lualine.lua @@ -0,0 +1,19 @@ +return { + "nvim-lualine/lualine.nvim", + config = function () + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'dracula-nvim', + }, + sections = { + lualine_a = { + { + 'filename', + path = 1, + } + } + } + } + end +} diff --git a/modules/home-manager/files/nvim/lua/plugins/mason-lspconfig.lua b/modules/home-manager/files/nvim/lua/plugins/mason-lspconfig.lua new file mode 100644 index 0000000..1b5dfba --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/mason-lspconfig.lua @@ -0,0 +1,14 @@ +return { + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", -- lua + "nil_ls", -- nix + "puppet", -- puppet + "ruff_lsp", -- python + } + }) + end +} + diff --git a/modules/home-manager/files/nvim/lua/plugins/mason-null-ls.lua b/modules/home-manager/files/nvim/lua/plugins/mason-null-ls.lua new file mode 100644 index 0000000..25a2812 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/mason-null-ls.lua @@ -0,0 +1,17 @@ +return { + "jay-babu/mason-null-ls.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "williamboman/mason.nvim", + "nvimtools/none-ls.nvim", + }, + config = function() + require("mason-null-ls").setup({ + ensure_installed = { + "prettier", -- HTML, JS, JSON, etc. + "ruff", -- Pyhton + "stylua", -- LUA + }, + }) + end, +} diff --git a/modules/home-manager/files/nvim/lua/plugins/mason.lua b/modules/home-manager/files/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..9d5d40a --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/mason.lua @@ -0,0 +1 @@ +return { "williamboman/mason.nvim", config = true } diff --git a/modules/home-manager/files/nvim/lua/plugins/neo-tree.lua b/modules/home-manager/files/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..fa0bdf3 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,25 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + lazy = false, + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function () + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + vim.keymap.set('n', '', ':Neotree toggle', {}) + require("neo-tree").setup({ + filesystem = { + hijack_netrw_behavior = "open_default" + }, + follow_current_file = { enabled = true }, + source_selector = { + winbar = true, + statusline = false + } + }) + end +} diff --git a/modules/home-manager/files/nvim/lua/plugins/none-ls.lua b/modules/home-manager/files/nvim/lua/plugins/none-ls.lua new file mode 100644 index 0000000..0c831fa --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/none-ls.lua @@ -0,0 +1,23 @@ +return { + "nvimtools/none-ls.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local null_ls = require("null-ls") + + null_ls.setup({ + sources = { + null_ls.builtins.completion.spell, + null_ls.builtins.diagnostics.puppet_lint, + null_ls.builtins.diagnostics.rubocop, + null_ls.builtins.diagnostics.ruff, + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.puppet_lint, + null_ls.builtins.formatting.rubocop, + null_ls.builtins.formatting.ruff_format, + null_ls.builtins.formatting.stylua, + }, + }) + + vim.keymap.set("n", "gf", vim.lsp.buf.format, {}) + end, +} diff --git a/modules/home-manager/files/nvim/lua/plugins/nvim-lspconfig.lua b/modules/home-manager/files/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..ac17bb5 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,26 @@ +return { + "neovim/nvim-lspconfig", + config = function () + local on_attach = function(_, _) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, {}) + vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, {}) + + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {}) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {}) + vim.keymap.set('n', 'gr', require('telescope.builtin').lsp_references, {}) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, {}) + end + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup { + on_attach = on_attach, + settings = { Lua = { diagnostics = { globals = {'vim'} } } }, + } + lspconfig.nil_ls.setup { on_attach = on_attach } + local puppet_languageserver = vim.fn.expand("$HOME/.local/share/nvim/mason/packages/puppet-editor-services/libexec/puppet-languageserver") + lspconfig.puppet.setup { + on_attach = on_attach, + cmd = { puppet_languageserver } + } + lspconfig.ruff_lsp.setup { on_attach = on_attach } + end + } diff --git a/modules/home-manager/files/nvim/lua/plugins/nvim-web-devicons.lua b/modules/home-manager/files/nvim/lua/plugins/nvim-web-devicons.lua new file mode 100644 index 0000000..ed57733 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/nvim-web-devicons.lua @@ -0,0 +1 @@ +return { "nvim-tree/nvim-web-devicons", config = true } diff --git a/modules/home-manager/files/nvim/lua/plugins/telescope-ui-select.lua b/modules/home-manager/files/nvim/lua/plugins/telescope-ui-select.lua new file mode 100644 index 0000000..078c00e --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/telescope-ui-select.lua @@ -0,0 +1,18 @@ +return { + "nvim-telescope/telescope-ui-select.nvim", + config = function () + -- This is your opts table + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({ + -- even more opts + }) + } + } + }) + -- load_extension, somewhere after setup function: + require("telescope").load_extension("ui-select") + end +} + diff --git a/modules/home-manager/files/nvim/lua/plugins/telescope.lua b/modules/home-manager/files/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..b0ad305 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/telescope.lua @@ -0,0 +1,13 @@ +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function () + local builtin = require('telescope.builtin') + + vim.keymap.set('n', '', builtin.find_files, {}) + vim.keymap.set('n', '', builtin.oldfiles, {}) + vim.keymap.set('n', 'fg', builtin.live_grep, {}) + vim.keymap.set('n', 'fh', builtin.help_tags, {}) + end +} diff --git a/modules/home-manager/files/nvim/lua/plugins/treesitter.lua b/modules/home-manager/files/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..f732616 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,53 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function () + local config = require('nvim-treesitter.configs') + config.setup { + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + sync_install = false, + ensure_installed = { + "bash", + "css", + "csv", + "diff", + "dockerfile", + "git_config", + "git_rebase", + "gitattributes", + "gitignore", + "go", + "hcl", + "hocon", + "html", + "javascript", + "json", + "lua", + "make", + "markdown", + "markdown_inline", + "nix", + "passwd", + "promql", + "puppet", + "python", + "regex", + --"pip_requirements", + "ruby", + "sql", + "ssh_config", + "terraform", + "toml", + "tsv", + "typescript", + "udev", + "vim", + "vimdoc", + "xml", + "yaml", + }, + } + end +} diff --git a/modules/home-manager/files/nvim/lua/plugins/trouble.lua b/modules/home-manager/files/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..be3f6f1 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/trouble.lua @@ -0,0 +1,5 @@ +return { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = true, +} diff --git a/modules/home-manager/files/nvim/lua/plugins/vim-tmux-navigator.lua b/modules/home-manager/files/nvim/lua/plugins/vim-tmux-navigator.lua new file mode 100644 index 0000000..d0865ab --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/vim-tmux-navigator.lua @@ -0,0 +1,3 @@ +return { + "christoomey/vim-tmux-navigator" +} diff --git a/modules/home-manager/files/nvim/lua/plugins/which-key.lua b/modules/home-manager/files/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..ce78289 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/which-key.lua @@ -0,0 +1 @@ +return { "folke/which-key.nvim", config = true } diff --git a/modules/system/common/all-darwin.nix b/modules/system/common/all-darwin.nix index c61090a..44a2af3 100644 --- a/modules/system/common/all-darwin.nix +++ b/modules/system/common/all-darwin.nix @@ -12,8 +12,6 @@ hugo mas nmap - nodejs - nodePackages.npm openjdk sops ssh-to-age