From 28d8213ebc33aef561d1e1c58c82a1780bd9b1b4 Mon Sep 17 00:00:00 2001 From: Patrick Michl Date: Tue, 5 Nov 2024 13:01:15 +0100 Subject: [PATCH] add config --- config/auto_cmds.nix | 20 ++ config/default.nix | 32 +++ config/plugins/cmp/cmp.nix | 116 ++++++++ config/plugins/cmp/lspkind.nix | 9 + config/plugins/cmp/schemastore.nix | 13 + config/plugins/editor/illuminate.nix | 13 + config/plugins/editor/navic.nix | 40 +++ config/plugins/editor/neo-tree.nix | 43 +++ config/plugins/editor/todo-comments.nix | 14 + config/plugins/editor/treesitter.nix | 61 ++++ config/plugins/git/gitsigns.nix | 27 ++ config/plugins/git/lazygit.nix | 24 ++ config/plugins/lsp/lsp.nix | 133 +++++++++ config/plugins/snippets/luasnip.nix | 9 + config/plugins/themes/default.nix | 67 +++++ config/plugins/ui/bufferline.nix | 26 ++ config/plugins/ui/lualine.nix | 94 +++++++ config/plugins/utils/extras.nix | 7 + config/plugins/utils/telescope.nix | 36 +++ config/plugins/utils/toggleterm.nix | 23 ++ config/settings.nix | 36 +++ flake.lock | 356 ++++++++++++++++++++++++ flake.nix | 41 +++ 23 files changed, 1240 insertions(+) create mode 100644 config/auto_cmds.nix create mode 100644 config/default.nix create mode 100644 config/plugins/cmp/cmp.nix create mode 100644 config/plugins/cmp/lspkind.nix create mode 100644 config/plugins/cmp/schemastore.nix create mode 100644 config/plugins/editor/illuminate.nix create mode 100644 config/plugins/editor/navic.nix create mode 100644 config/plugins/editor/neo-tree.nix create mode 100644 config/plugins/editor/todo-comments.nix create mode 100644 config/plugins/editor/treesitter.nix create mode 100644 config/plugins/git/gitsigns.nix create mode 100644 config/plugins/git/lazygit.nix create mode 100644 config/plugins/lsp/lsp.nix create mode 100644 config/plugins/snippets/luasnip.nix create mode 100644 config/plugins/themes/default.nix create mode 100644 config/plugins/ui/bufferline.nix create mode 100644 config/plugins/ui/lualine.nix create mode 100644 config/plugins/utils/extras.nix create mode 100644 config/plugins/utils/telescope.nix create mode 100644 config/plugins/utils/toggleterm.nix create mode 100644 config/settings.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/config/auto_cmds.nix b/config/auto_cmds.nix new file mode 100644 index 0000000..6788244 --- /dev/null +++ b/config/auto_cmds.nix @@ -0,0 +1,20 @@ +{ + autoGroups = { + highlight_yank = {}; + }; + + autoCmd = [ + { + group = "highlight_yank"; + event = ["TextYankPost"]; + pattern = "*"; + callback = { + __raw = '' + function() + vim.highlight.on_yank() + end + ''; + }; + } + ]; +} diff --git a/config/default.nix b/config/default.nix new file mode 100644 index 0000000..2b6f5f2 --- /dev/null +++ b/config/default.nix @@ -0,0 +1,32 @@ +_: { + imports = [ + ./settings.nix + ./auto_cmds.nix + + ./plugins/themes/default.nix + + ./plugins/utils/telescope.nix + ./plugins/utils/toggleterm.nix + ./plugins/utils/extras.nix + + ./plugins/git/lazygit.nix + ./plugins/git/gitsigns.nix + + ./plugins/lsp/lsp.nix + + ./plugins/editor/navic.nix + ./plugins/editor/illuminate.nix + ./plugins/editor/neo-tree.nix + ./plugins/editor/todo-comments.nix + ./plugins/editor/treesitter.nix + + ./plugins/ui/bufferline.nix + ./plugins/ui/lualine.nix + + ./plugins/snippets/luasnip.nix + + ./plugins/cmp/cmp.nix + ./plugins/cmp/lspkind.nix + ./plugins/cmp/schemastore.nix + ]; +} diff --git a/config/plugins/cmp/cmp.nix b/config/plugins/cmp/cmp.nix new file mode 100644 index 0000000..e22b48a --- /dev/null +++ b/config/plugins/cmp/cmp.nix @@ -0,0 +1,116 @@ +{ + plugins = { + cmp-emoji.enable = true; + cmp-nvim-lsp.enable = true; + cmp-buffer.enable = true; + cmp-path.enable = true; + cmp_luasnip.enable = true; + cmp-cmdline.enable = false; + cmp = { + enable = true; + settings = { + autoEnableSources = true; + experimental = {ghost_text = false;}; + performance = { + debounce = 60; + fetchingTimeout = 200; + maxViewEntries = 30; + }; + snippet = {expand = "luasnip";}; + formatting = {fields = ["kind" "abbr" "menu"];}; + sources = [ + {name = "git";} + {name = "nvim_lsp";} + {name = "emoji";} + { + name = "buffer"; # text within current buffer + option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; + keywordLength = 3; + } + { + name = "path"; # file system paths + keywordLength = 3; + } + { + name = "luasnip"; # snippets + keywordLength = 3; + } + ]; + + window = { + completion = {border = "solid";}; + documentation = {border = "solid";}; + }; + + mapping = { + "" = + /* + lua + */ + "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + "" = + /* + lua + */ + "cmp.mapping.select_next_item()"; + "" = + /* + lua + */ + "cmp.mapping.select_prev_item()"; + "" = + /* + lua + */ + "cmp.mapping.abort()"; + "" = + /* + lua + */ + "cmp.mapping.scroll_docs(-4)"; + "" = + /* + lua + */ + "cmp.mapping.scroll_docs(4)"; + "" = + /* + lua + */ + "cmp.mapping.complete()"; + "" = + /* + lua + */ + "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })"; + "" = + /* + lua + */ + '' + function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end + ''; + "" = + /* + lua + */ + '' + function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end + ''; + }; + }; + }; + }; +} diff --git a/config/plugins/cmp/lspkind.nix b/config/plugins/cmp/lspkind.nix new file mode 100644 index 0000000..ab4946a --- /dev/null +++ b/config/plugins/cmp/lspkind.nix @@ -0,0 +1,9 @@ +{ + plugins.lspkind = { + enable = true; + extraOptions = { + maxwidth = 50; + ellipsis_char = "..."; + }; + }; +} diff --git a/config/plugins/cmp/schemastore.nix b/config/plugins/cmp/schemastore.nix new file mode 100644 index 0000000..40bf9e1 --- /dev/null +++ b/config/plugins/cmp/schemastore.nix @@ -0,0 +1,13 @@ +{ + plugins.schemastore = { + enable = true; + + json = { + enable = true; + }; + + yaml = { + enable = true; + }; + }; +} diff --git a/config/plugins/editor/illuminate.nix b/config/plugins/editor/illuminate.nix new file mode 100644 index 0000000..7bfedb7 --- /dev/null +++ b/config/plugins/editor/illuminate.nix @@ -0,0 +1,13 @@ +{ + plugins.illuminate = { + enable = true; + underCursor = false; + filetypesDenylist = [ + "Outline" + "TelescopePrompt" + "alpha" + "harpoon" + "reason" + ]; + }; +} diff --git a/config/plugins/editor/navic.nix b/config/plugins/editor/navic.nix new file mode 100644 index 0000000..4fd2d11 --- /dev/null +++ b/config/plugins/editor/navic.nix @@ -0,0 +1,40 @@ +_: { + plugins.navic = { + enable = true; + settings = { + separator = "  "; + highlight = true; + depthLimit = 5; + lsp = { + autoAttach = true; + }; + icons = { + Array = "󱃵 "; + Boolean = " "; + Class = " "; + Constant = " "; + Constructor = " "; + Enum = " "; + EnumMember = " "; + Event = " "; + Field = "󰽏 "; + File = " "; + Function = "󰡱 "; + Interface = " "; + Key = " "; + Method = " "; + Module = "󰕳 "; + Namespace = " "; + Null = "󰟢 "; + Number = " "; + Object = " "; + Operator = " "; + Package = "󰏖 "; + String = " "; + Struct = " "; + TypeParameter = " "; + Variable = " "; + }; + }; + }; +} diff --git a/config/plugins/editor/neo-tree.nix b/config/plugins/editor/neo-tree.nix new file mode 100644 index 0000000..cf11b14 --- /dev/null +++ b/config/plugins/editor/neo-tree.nix @@ -0,0 +1,43 @@ +{ + plugins.neo-tree = { + enable = true; + sources = ["filesystem" "buffers" "git_status" "document_symbols"]; + addBlankLineAtTop = false; + + filesystem = { + bindToCwd = true; + }; + + defaultComponentConfigs = { + indent = { + withExpanders = true; + expanderCollapsed = "󰅂"; + expanderExpanded = "󰅀"; + expanderHighlight = "NeoTreeExpander"; + }; + + gitStatus = { + symbols = { + added = " "; + conflict = "󰩌 "; + deleted = "󱂥"; + ignored = " "; + modified = " "; + renamed = "󰑕"; + staged = "󰩍"; + unstaged = ""; + untracked = " "; + }; + }; + }; + }; + + keymaps = [ + { + mode = ["n"]; + key = ""; + action = "Neotree toggle"; + options = {desc = "Open/Close Neotree";}; + } + ]; +} diff --git a/config/plugins/editor/todo-comments.nix b/config/plugins/editor/todo-comments.nix new file mode 100644 index 0000000..22e9090 --- /dev/null +++ b/config/plugins/editor/todo-comments.nix @@ -0,0 +1,14 @@ +{ + plugins.todo-comments = { + enable = true; + settings = { + colors = { + error = ["DiagnosticError" "ErrorMsg" "#ED8796"]; + warning = ["DiagnosticWarn" "WarningMsg" "#EED49F"]; + info = ["DiagnosticInfo" "#EED49F"]; + default = ["Identifier" "#F5A97F"]; + test = ["Identifier" "#8AADF4"]; + }; + }; + }; +} diff --git a/config/plugins/editor/treesitter.nix b/config/plugins/editor/treesitter.nix new file mode 100644 index 0000000..fc6f2d3 --- /dev/null +++ b/config/plugins/editor/treesitter.nix @@ -0,0 +1,61 @@ +{pkgs, ...}: { + plugins.treesitter = { + enable = true; + settings = { + indent.enable = true; + highlight.enable = true; + }; + folding = false; + nixvimInjections = true; + grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars; + }; + + plugins.treesitter-textobjects = { + enable = false; + select = { + enable = true; + lookahead = true; + keymaps = { + "aa" = "@parameter.outer"; + "ia" = "@parameter.inner"; + "af" = "@function.outer"; + "if" = "@function.inner"; + "ac" = "@class.outer"; + "ic" = "@class.inner"; + "ii" = "@conditional.inner"; + "ai" = "@conditional.outer"; + "il" = "@loop.inner"; + "al" = "@loop.outer"; + "at" = "@comment.outer"; + }; + }; + move = { + enable = true; + gotoNextStart = { + "]m" = "@function.outer"; + "]]" = "@class.outer"; + }; + gotoNextEnd = { + "]M" = "@function.outer"; + "][" = "@class.outer"; + }; + gotoPreviousStart = { + "[m" = "@function.outer"; + "[[" = "@class.outer"; + }; + gotoPreviousEnd = { + "[M" = "@function.outer"; + "[]" = "@class.outer"; + }; + }; + swap = { + enable = true; + swapNext = { + "a" = "@parameters.inner"; + }; + swapPrevious = { + "A" = "@parameter.outer"; + }; + }; + }; +} diff --git a/config/plugins/git/gitsigns.nix b/config/plugins/git/gitsigns.nix new file mode 100644 index 0000000..f66cffe --- /dev/null +++ b/config/plugins/git/gitsigns.nix @@ -0,0 +1,27 @@ +_: { + plugins.gitsigns = { + enable = true; + settings = { + signs = { + add = { + text = " "; + }; + change = { + text = " "; + }; + delete = { + text = " "; + }; + untracked = { + text = ""; + }; + topdelete = { + text = "󱂥 "; + }; + changedelete = { + text = "󱂧 "; + }; + }; + }; + }; +} diff --git a/config/plugins/git/lazygit.nix b/config/plugins/git/lazygit.nix new file mode 100644 index 0000000..4783678 --- /dev/null +++ b/config/plugins/git/lazygit.nix @@ -0,0 +1,24 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + lazygit-nvim + ]; + + extraConfigLua = + /* + lua + */ + '' + require("telescope").load_extension("lazygit") + ''; + + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "LazyGit"; + options = { + desc = "LazyGit (root dir)"; + }; + } + ]; +} diff --git a/config/plugins/lsp/lsp.nix b/config/plugins/lsp/lsp.nix new file mode 100644 index 0000000..83f0c7d --- /dev/null +++ b/config/plugins/lsp/lsp.nix @@ -0,0 +1,133 @@ +{pkgs, ...}: { + plugins = { + lsp-lines.enable = true; + lsp-format.enable = true; + lsp = { + enable = true; + inlayHints = true; + servers = { + html.enable = true; + lua_ls.enable = true; + nil_ls.enable = true; + marksman.enable = true; + ansiblels.enable = true; + jsonls.enable = true; + solargraph.enable = true; + bashls.enable = true; + yamlls = { + enable = true; + extraOptions = { + settings = { + yaml = { + schemas = { + kubernetes = ".h8s/*.{yml,yaml}"; + "http://json.schemastore.org/github-workflow" = ".github/workflows/*"; + "http://json.schemastore.org/github-action" = ".github/action.{yml,yaml}"; + "http://json.schemastore.org/ansible-stable-2.9" = "roles/tasks/*.{yml,yaml}"; + "http://json.schemastore.org/kustomization" = "kustomization.{yml,yaml}"; + "http://json.schemastore.org/ansible-playbook" = "*play*.{yml,yaml}"; + "http://json.schemastore.org/chart" = "Chart.{yml,yaml}"; + "https://json.schemastore.org/dependabot-v2" = ".github/dependabot.{yml,yaml}"; + "https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json" = "*docker-compose*.{yml,yaml}"; + "https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json" = "*flow*.{yml,yaml}"; + "https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json" = ".gitlab-ci.yml"; + }; + }; + }; + }; + }; + }; + + keymaps = { + silent = true; + lspBuf = { + gd = { + action = "definition"; + desc = "Goto Definition"; + }; + gr = { + action = "references"; + desc = "Goto References"; + }; + gD = { + action = "declaration"; + desc = "Goto Declaration"; + }; + gI = { + action = "implementation"; + desc = "Goto Implementation"; + }; + gT = { + action = "type_definition"; + desc = "Type Definition"; + }; + ga = { + action = "code_action"; + desc = "Code Action"; + }; + ff = { + action = "format"; + desc = "Format Code"; + }; + K = { + action = "hover"; + desc = "Hover"; + }; + "cw" = { + action = "workspace_symbol"; + desc = "Workspace Symbol"; + }; + "cr" = { + action = "rename"; + desc = "Rename"; + }; + }; + diagnostic = { + "cd" = { + action = "open_float"; + desc = "Line Diagnostics"; + }; + "[d" = { + action = "goto_next"; + desc = "Next Diagnostic"; + }; + "]d" = { + action = "goto_prev"; + desc = "Previous Diagnostic"; + }; + }; + }; + }; + }; + extraPlugins = with pkgs.vimPlugins; [ + ansible-vim + ]; + + extraConfigLua = + /* + lua + */ + '' + local _border = "rounded" + + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = _border + } + ) + + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = _border + } + ) + + vim.diagnostic.config{ + float={border=_border} + }; + + require('lspconfig.ui.windows').default_options = { + border = _border + } + ''; +} diff --git a/config/plugins/snippets/luasnip.nix b/config/plugins/snippets/luasnip.nix new file mode 100644 index 0000000..383e83d --- /dev/null +++ b/config/plugins/snippets/luasnip.nix @@ -0,0 +1,9 @@ +{ + plugins.luasnip = { + enable = true; + settings = { + enable_autosnippets = true; + store_selection_keys = ""; + }; + }; +} diff --git a/config/plugins/themes/default.nix b/config/plugins/themes/default.nix new file mode 100644 index 0000000..785e588 --- /dev/null +++ b/config/plugins/themes/default.nix @@ -0,0 +1,67 @@ +{ + colorschemes = { + catppuccin = { + enable = true; + settings = { + background = { + light = "macchiato"; + dark = "mocha"; + }; + custom_highlights = '' + function(highlights) + return { + CursorLineNr = { fg = highlights.peach, style = {} }, + NavicText = { fg = highlights.text }, + } + end + ''; + flavour = "macchiato"; + no_bold = false; + no_italic = false; + no_underline = false; + transparent_background = false; + integrations = { + cmp = true; + notify = true; + gitsigns = true; + neotree = true; + which_key = true; + illuminate = { + enabled = true; + lsp = true; + }; + navic = { + enabled = true; + custom_bg = "NONE"; + }; + treesitter = true; + telescope.enabled = true; + indent_blankline.enabled = true; + mini = { + enabled = true; + indentscope_color = "rosewater"; + }; + native_lsp = { + enabled = true; + inlay_hints = { + background = true; + }; + virtual_text = { + errors = ["italic"]; + hints = ["italic"]; + information = ["italic"]; + warnings = ["italic"]; + ok = ["italic"]; + }; + underlines = { + errors = ["underline"]; + hints = ["underline"]; + information = ["underline"]; + warnings = ["underline"]; + }; + }; + }; + }; + }; + }; +} diff --git a/config/plugins/ui/bufferline.nix b/config/plugins/ui/bufferline.nix new file mode 100644 index 0000000..ce1bc53 --- /dev/null +++ b/config/plugins/ui/bufferline.nix @@ -0,0 +1,26 @@ +{ + plugins = { + bufferline = { + enable = true; + settings = { + options = { + diagnostics = "nvim_lsp"; + mode = "buffers"; + + close_icon = " "; + buffer_close_icon = "󰱝 "; + modified_icon = "󰔯 "; + + offsets = [ + { + filetype = "neo-tree"; + text = "Neo-tree"; + highlight = "Directory"; + text_align = "left"; + } + ]; + }; + }; + }; + }; +} diff --git a/config/plugins/ui/lualine.nix b/config/plugins/ui/lualine.nix new file mode 100644 index 0000000..ef45dee --- /dev/null +++ b/config/plugins/ui/lualine.nix @@ -0,0 +1,94 @@ +{ + plugins.lualine = { + enable = true; + settings = { + options = { + globalstatus = true; + extensions = [ + "fzf" + "neo-tree" + ]; + disabledFiletypes = { + statusline = ["startup" "alpha"]; + }; + theme = "catppuccin"; + }; + sections = { + lualine_a = [ + { + __unkeyed-1 = "mode"; + icon = ""; + } + ]; + lualine_b = [ + { + __unkeyed-1 = "branch"; + icon = ""; + } + { + __unkeyed-1 = "diff"; + symbols = { + added = " "; + modified = " "; + removed = " "; + }; + } + ]; + lualine_c = [ + { + __unkeyed-1 = "diagnostics"; + sources = ["nvim_lsp"]; + symbols = { + error = " "; + warn = " "; + info = " "; + hint = "󰝶 "; + }; + } + { + __unkeyed-1 = "navic"; + } + ]; + lualine_x = [ + { + __unkeyed-1 = "filetype"; + icon_only = true; + separator = ""; + padding = { + left = 1; + right = 0; + }; + } + { + __unkeyed-1 = "filename"; + path = 1; + } + { + __unkeyed-1.__raw = '' + function() + local icon = " " + local status = require("copilot.api").status.data + return icon .. (status.message or " ") + end, + + cond = function() + local ok, clients = pcall(vim.lsp.get_clients, { name = "copilot", bufnr = 0 }) + return ok and #clients > 0 + end, + ''; + } + ]; + lualine_y = [ + { + __unkeyed-1 = "progress"; + } + ]; + lualine_z = [ + { + __unkeyed-1 = "location"; + } + ]; + }; + }; + }; +} diff --git a/config/plugins/utils/extras.nix b/config/plugins/utils/extras.nix new file mode 100644 index 0000000..72c790b --- /dev/null +++ b/config/plugins/utils/extras.nix @@ -0,0 +1,7 @@ +{ + plugins = { + web-devicons.enable = true; + which-key.enable = true; + fidget.enable = true; + }; +} diff --git a/config/plugins/utils/telescope.nix b/config/plugins/utils/telescope.nix new file mode 100644 index 0000000..4e23a87 --- /dev/null +++ b/config/plugins/utils/telescope.nix @@ -0,0 +1,36 @@ +{ + plugins.telescope = { + enable = true; + + extensions = { + file-browser.enable = true; + fzf-native.enable = true; + }; + + keymaps = { + ";" = { + action = "find_files"; + options.desc = "Find project files"; + }; + + "g" = { + action = "live_grep"; + options.desc = "Grep from root dir"; + }; + }; + }; + + extraConfigLua = + /* + lua + */ + '' + require("telescope").setup{ + pickers = { + colorscheme = { + enable_preview = true + } + } + } + ''; +} diff --git a/config/plugins/utils/toggleterm.nix b/config/plugins/utils/toggleterm.nix new file mode 100644 index 0000000..1e95e3c --- /dev/null +++ b/config/plugins/utils/toggleterm.nix @@ -0,0 +1,23 @@ +{ + plugins.toggleterm = { + enable = true; + + settings = { + size = 20; + close_on_exit = false; + hide_numbers = true; + shade_terminals = true; + shading_factor = 1; + start_in_insert = true; + persist_size = true; + }; + }; + keymaps = [ + { + mode = ["n" "i"]; + key = ""; + action = "ToggleTerm direction=horizontal"; + options.desc = "Toggle Horizontal Terminal Window"; + } + ]; +} diff --git a/config/settings.nix b/config/settings.nix new file mode 100644 index 0000000..d1bdece --- /dev/null +++ b/config/settings.nix @@ -0,0 +1,36 @@ +{ + config = { + clipboard.providers.wl-copy.enable = true; + + opts = { + number = true; + relativenumber = true; + clipboard = "unnamedplus"; + + tabstop = 2; + softtabstop = 2; + showtabline = 2; + expandtab = true; + + smartindent = true; + shiftwidth = 2; + breakindent = true; + + cursorline = true; + scrolloff = 8; + + mouse = "a"; + + foldmethod = "manual"; + foldenable = false; + linebreak = true; + + showmode = false; + spell = false; + swapfile = false; + timeoutlen = 300; + termguicolors = true; + cmdheight = 0; + }; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8c673ca --- /dev/null +++ b/flake.lock @@ -0,0 +1,356 @@ +{ + "nodes": { + "devshell": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1728330715, + "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", + "owner": "numtide", + "repo": "devshell", + "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-compat": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730302582, + "narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730633670, + "narHash": "sha256-ZFJqIXpvVKvzOVFKWNRDyIyAo+GYdmEPaYi1bZB6uf0=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "8f6ca7855d409aeebe2a582c6fd6b6a8d0bf5661", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729544999, + "narHash": "sha256-YcyJLvTmN6uLEBGCvYoMLwsinblXMkoYkNLEO4WnKus=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "65c207c92befec93e22086da9456d3906a4e999c", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.0.5", + "repo": "ixx", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730600078, + "narHash": "sha256-BoyFmE59HDF3uybBySsWVoyjNuHvz3Wv8row/mSb958=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4652874d014b82cb746173ffc64f6a70044daa7e", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1730504152, + "narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts_2", + "git-hooks": "git-hooks", + "home-manager": "home-manager", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs_2", + "nuschtosSearch": "nuschtosSearch", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1730792264, + "narHash": "sha256-Ue3iywjyaNOxXgw7esVSBX3bZzM2bSPubZamYsBKIG8=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "3d24cb72618738130e6af9c644c81fe42aa34ebc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730515563, + "narHash": "sha256-8lklUZRV7nwkPLF3roxzi4C2oyLydDXyAzAnDvjkOms=", + "owner": "NuschtOS", + "repo": "search", + "rev": "9e22bd742480916ff5d0ab20ca2522eaa3fa061e", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "nixvim": "nixvim" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730321837, + "narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "746901bb8dba96d154b66492a29f5db0693dbfcc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d3f5f1b --- /dev/null +++ b/flake.nix @@ -0,0 +1,41 @@ +{ + description = "My NeoVim configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + nixvim.url = "github:nix-community/nixvim"; + }; + + outputs = { + nixvim, + flake-parts, + ... + } @ inputs: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin"]; + + perSystem = { + system, + pkgs, + ... + }: let + nixvim' = nixvim.legacyPackages.${system}; + nvim = nixvim'.makeNixvimWithModule { + inherit pkgs; + module = ./config; + }; + in { + checks = { + default = nixvim.lib.${system}.check.mkTestDerivationFromNvim { + inherit nvim; + name = "A nixvim configuration"; + }; + }; + + formatter = pkgs.alejandra; + + packages.default = nvim; + }; + }; +}