diff --git a/config/default.nix b/config/default.nix index 4b7800a..15997fd 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ # General configuration. ./keymaps.nix @@ -39,4 +37,3 @@ ./plugins/utils/whichkey.nix ]; } - diff --git a/config/keymaps.nix b/config/keymaps.nix index e1848c1..96b943e 100644 --- a/config/keymaps.nix +++ b/config/keymaps.nix @@ -1,6 +1,3 @@ -{ ... }: - -{ +{...}: { globals.mapleader = " "; } - diff --git a/config/options.nix b/config/options.nix index 0003751..0a0e75d 100644 --- a/config/options.nix +++ b/config/options.nix @@ -1,18 +1,15 @@ -{ ... }: - -{ +{...}: { config.opts = { # General - number = true; # Display line numbers. - showmode = false; # Do not show the mode we're editing in. - swapfile = false; # Disable vim swapfile. - clipboard = "unnamedplus"; # Use the clipboard for all operations. + number = true; # Display line numbers. + showmode = false; # Do not show the mode we're editing in. + swapfile = false; # Disable vim swapfile. + clipboard = "unnamedplus"; # Use the clipboard for all operations. # Tabs & Spaces - tabstop = 2; # Set the width of a tab character. - softtabstop = 2; # Set the number of columns for a tab. - shiftwidth = 2; # Set the number of spaces for each step of (auto)indent. - expandtab = true; # Convert tabs to spaces. + tabstop = 2; # Set the width of a tab character. + softtabstop = 2; # Set the number of columns for a tab. + shiftwidth = 2; # Set the number of spaces for each step of (auto)indent. + expandtab = true; # Convert tabs to spaces. }; } - diff --git a/config/plugins/cmp/cmp.nix b/config/plugins/cmp/cmp.nix index d865de2..a52d20c 100644 --- a/config/plugins/cmp/cmp.nix +++ b/config/plugins/cmp/cmp.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { # Autocompletion plugin plugins.cmp = { enable = true; @@ -8,8 +6,8 @@ settings = { # The sources to use sources = [ - { name = "nvim_lsp"; } # LSP source for cmp - { name = "luasnip"; } # Snippets source for cmp + {name = "nvim_lsp";} # LSP source for cmp + {name = "luasnip";} # Snippets source for cmp ]; # The snippet expansion function. snippet.expand = '' @@ -35,4 +33,3 @@ autoEnableSources = true; }; } - diff --git a/config/plugins/editor/bufdelete.nix b/config/plugins/editor/bufdelete.nix index 75dbcdd..33b328a 100644 --- a/config/plugins/editor/bufdelete.nix +++ b/config/plugins/editor/bufdelete.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { plugins.bufdelete = { enable = true; }; @@ -20,4 +18,3 @@ } ]; } - diff --git a/config/plugins/editor/comment.nix b/config/plugins/editor/comment.nix index 4ba4e63..a682347 100644 --- a/config/plugins/editor/comment.nix +++ b/config/plugins/editor/comment.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { plugins.comment = { enable = true; settings = { @@ -30,4 +28,3 @@ }; }; } - diff --git a/config/plugins/editor/neo-tree.nix b/config/plugins/editor/neo-tree.nix index 922a204..a1f3b66 100644 --- a/config/plugins/editor/neo-tree.nix +++ b/config/plugins/editor/neo-tree.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { plugins.neo-tree = { enable = true; }; @@ -14,4 +12,3 @@ } ]; } - diff --git a/config/plugins/editor/treesitter.nix b/config/plugins/editor/treesitter.nix index cb1248c..d9dba45 100644 --- a/config/plugins/editor/treesitter.nix +++ b/config/plugins/editor/treesitter.nix @@ -1,13 +1,11 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { # Tree-sitter is a parser generator tool and an incremental parsing library. plugins.treesitter = { enable = true; # Options provided to the require('nvim-treesitter.configs').setup function. settings = { - highlight = { + highlight = { enable = true; # Enable syntax highlighing. }; indent = { @@ -21,4 +19,3 @@ grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars; }; } - diff --git a/config/plugins/git/fugitive.nix b/config/plugins/git/fugitive.nix index 2e07407..f440e26 100644 --- a/config/plugins/git/fugitive.nix +++ b/config/plugins/git/fugitive.nix @@ -1,8 +1,5 @@ -{ ... }: - -{ +{...}: { plugins.fugitive = { enable = true; }; } - diff --git a/config/plugins/git/gitsigns.nix b/config/plugins/git/gitsigns.nix index 010f9dd..c9d5aeb 100644 --- a/config/plugins/git/gitsigns.nix +++ b/config/plugins/git/gitsigns.nix @@ -1,13 +1,11 @@ -{ ... }: - -{ +{...}: { plugins.gitsigns = { enable = true; }; keymaps = [ { - mode = [ "n" "v" ]; + mode = ["n" "v"]; key = "hs"; action = "Gitsigns stage_hunk"; options = { @@ -17,7 +15,7 @@ } { - mode = [ "n" "v" ]; + mode = ["n" "v"]; key = "hr"; action = "Gitsigns reset_hunk"; options = { @@ -107,4 +105,3 @@ } ]; } - diff --git a/config/plugins/git/lazygit.nix b/config/plugins/git/lazygit.nix index 8add97d..a932071 100644 --- a/config/plugins/git/lazygit.nix +++ b/config/plugins/git/lazygit.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { plugins.lazygit = { enable = true; }; @@ -29,4 +27,3 @@ require("telescope").load_extension("lazygit") ''; } - diff --git a/config/plugins/lsp/conform.nix b/config/plugins/lsp/conform.nix index 90b1dd0..e006439 100644 --- a/config/plugins/lsp/conform.nix +++ b/config/plugins/lsp/conform.nix @@ -1,6 +1,4 @@ -{pkgs, ...}: - -{ +{pkgs, ...}: { plugins.conform-nvim = { enable = true; @@ -18,7 +16,7 @@ nix = ["alejandra"]; }; }; - + # Install our formatters. extraPackages = with pkgs; [ alejandra diff --git a/config/plugins/lsp/lsp.nix b/config/plugins/lsp/lsp.nix index 1ebfaff..f18c3ca 100644 --- a/config/plugins/lsp/lsp.nix +++ b/config/plugins/lsp/lsp.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { plugins.lsp = { enable = true; # Enable neovim's built-in LSP. @@ -35,23 +33,22 @@ keymaps = { # nvim-lsp keymaps should be silent silent = true; - # Configure keymaps for our diagnostics. + # Configure keymaps for our diagnostics. diagnostic = { "n" = "open_float"; # Show diagnostics in floating window. - "o" = "goto_prev"; # Jump to previous diagnostic. - "e" = "goto_next"; # Jump to next diagnostic. + "o" = "goto_prev"; # Jump to previous diagnostic. + "e" = "goto_next"; # Jump to next diagnostic. }; # Configure keymaps for our lspbuf. lspBuf = { - K = "hover"; # Displays hover information¹ - gr = "references"; # Lists all the references¹ - gd = "definition"; # Jumps to the definition¹ - gD = "declaration"; # Jumps to the declaration¹ - gi = "implementation"; # Lists all the implementations¹ + K = "hover"; # Displays hover information¹ + gr = "references"; # Lists all the references¹ + gd = "definition"; # Jumps to the definition¹ + gD = "declaration"; # Jumps to the declaration¹ + gi = "implementation"; # Lists all the implementations¹ gt = "type_definition"; # Jumps to the definition of the type¹ # ¹ for the symbol under the cursor }; }; }; } - diff --git a/config/plugins/snippets/luasnip.nix b/config/plugins/snippets/luasnip.nix index 5a65a43..e499d5c 100644 --- a/config/plugins/snippets/luasnip.nix +++ b/config/plugins/snippets/luasnip.nix @@ -1,12 +1,9 @@ -{ ... }: - -{ +{...}: { plugins.luasnip = { enable = true; extraConfig = { enable_autosnippets = true; store_selection_keys = ""; - }; + }; }; } - diff --git a/config/plugins/themes/default.nix b/config/plugins/themes/default.nix index 7ed7d21..ee80ca1 100644 --- a/config/plugins/themes/default.nix +++ b/config/plugins/themes/default.nix @@ -1,10 +1,8 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { extraPlugins = with pkgs.vimPlugins; [ gruvbox-material ]; - + extraConfigLua = '' vim.o.termguicolors = true vim.g.gruvbox_material_background = 'hard' @@ -12,4 +10,3 @@ vim.cmd.colorscheme('gruvbox-material') ''; } - diff --git a/config/plugins/ui/lualine.nix b/config/plugins/ui/lualine.nix index 49be531..8a603d5 100644 --- a/config/plugins/ui/lualine.nix +++ b/config/plugins/ui/lualine.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { plugins.lualine = { enable = true; globalstatus = true; @@ -12,14 +10,20 @@ ]; # Icons for our separators - componentSeparators = { left = ""; right = ""; }; - sectionSeparators = { left = ""; right = ""; }; + componentSeparators = { + left = ""; + right = ""; + }; + sectionSeparators = { + left = ""; + right = ""; + }; # Display components in tabline tabline = { - lualine_a = [ { name = "buffers"; } ]; - lualine_x = [ { name = "hostname"; } ]; - lualine_z = [ { name = "encoding"; } ]; + lualine_a = [{name = "buffers";}]; + lualine_x = [{name = "hostname";}]; + lualine_z = [{name = "encoding";}]; }; # Lualine has sections as shown below @@ -28,15 +32,19 @@ # +-------------------------------------------------+ sections = { # Section A - lualine_a = [ { name = "mode"; } ]; + lualine_a = [{name = "mode";}]; # Section B lualine_b = [ # Git branch - { name = "branch"; icon = ""; } + { + name = "branch"; + icon = ""; + } # Git diff status - { name = "diff"; + { + name = "diff"; extraConfig.symbols = { added = "+"; modified = "~"; @@ -46,14 +54,15 @@ ]; # Section C - lualine_c = [ { name = "filename"; } ]; + lualine_c = [{name = "filename";}]; # Section X lualine_x = [ # Diagnostic count from nvim_lsp - { name = "diagnostics"; + { + name = "diagnostics"; extraConfig = { - sources = [ "nvim_lsp" ]; + sources = ["nvim_lsp"]; symbols = { error = "error:"; warn = "warning:"; @@ -65,11 +74,10 @@ ]; # Section Y - lualine_y = [ { name = "progress"; } ]; + lualine_y = [{name = "progress";}]; # Section Z - lualine_z = [ { name = "location"; } ]; + lualine_z = [{name = "location";}]; }; }; } - diff --git a/config/plugins/utils/markdown-preview.nix b/config/plugins/utils/markdown-preview.nix index cd79c4b..7c6f19c 100644 --- a/config/plugins/utils/markdown-preview.nix +++ b/config/plugins/utils/markdown-preview.nix @@ -1,8 +1,5 @@ -{ ... }: - -{ +{...}: { plugins.markdown-preview = { enable = true; }; } - diff --git a/config/plugins/utils/neoclip.nix b/config/plugins/utils/neoclip.nix index ff81c2f..d536b16 100644 --- a/config/plugins/utils/neoclip.nix +++ b/config/plugins/utils/neoclip.nix @@ -1,18 +1,17 @@ -{ pkgs, ... }: - -{ - extraPlugins = [(pkgs.vimUtils.buildVimPlugin { - name = "neoclip"; - src = pkgs.fetchFromGitHub { - owner = "AckslD"; - repo = "nvim-neoclip.lua"; - rev = "709c97f"; - hash = "sha256-8ZPmxVM4dzjJxAYUHRMCiAQBxZEGHtsgSCNlCZBRBWo="; - }; - })]; +{pkgs, ...}: { + extraPlugins = [ + (pkgs.vimUtils.buildVimPlugin { + name = "neoclip"; + src = pkgs.fetchFromGitHub { + owner = "AckslD"; + repo = "nvim-neoclip.lua"; + rev = "709c97f"; + hash = "sha256-8ZPmxVM4dzjJxAYUHRMCiAQBxZEGHtsgSCNlCZBRBWo="; + }; + }) + ]; extraConfigLua = "require('neoclip').setup({ default_register = {'\"', '+'} })"; } - diff --git a/config/plugins/utils/software-licenses.nix b/config/plugins/utils/software-licenses.nix index c3784ce..3ddc586 100644 --- a/config/plugins/utils/software-licenses.nix +++ b/config/plugins/utils/software-licenses.nix @@ -1,14 +1,13 @@ -{ pkgs, ... }: - -{ - extraPlugins = [(pkgs.vimUtils.buildVimPlugin { - name = "software-licenses"; - src = pkgs.fetchFromGitHub { - owner = "chip"; - repo = "telescope-software-licenses.nvim"; - rev = "fb5fc33"; - hash = "sha256-luyCjkZSm1F6qoRpP5hHRAx4632u6JFuX2s7m2s8y60="; - }; - })]; +{pkgs, ...}: { + extraPlugins = [ + (pkgs.vimUtils.buildVimPlugin { + name = "software-licenses"; + src = pkgs.fetchFromGitHub { + owner = "chip"; + repo = "telescope-software-licenses.nvim"; + rev = "fb5fc33"; + hash = "sha256-luyCjkZSm1F6qoRpP5hHRAx4632u6JFuX2s7m2s8y60="; + }; + }) + ]; } - diff --git a/config/plugins/utils/telescope.nix b/config/plugins/utils/telescope.nix index 2f90d2a..9e01993 100644 --- a/config/plugins/utils/telescope.nix +++ b/config/plugins/utils/telescope.nix @@ -1,8 +1,6 @@ -{ ... }: - -{ +{...}: { imports = [ - ./neoclip.nix # Persistent clipboard. + ./neoclip.nix # Persistent clipboard. ./software-licenses.nix # View common software licenses. ]; @@ -99,4 +97,3 @@ }; }; } - diff --git a/config/plugins/utils/whichkey.nix b/config/plugins/utils/whichkey.nix index 5013e50..cfeac59 100644 --- a/config/plugins/utils/whichkey.nix +++ b/config/plugins/utils/whichkey.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { plugins.which-key = { enable = true; }; @@ -53,7 +51,7 @@ } { - mode = [ "n" "v" ]; + mode = ["n" "v"]; key = "c"; action = ""; options = { @@ -80,4 +78,3 @@ } ]; } - diff --git a/flake.nix b/flake.nix index 00c39ef..22ea14d 100644 --- a/flake.nix +++ b/flake.nix @@ -7,9 +7,12 @@ flake-parts.url = "github:hercules-ci/flake-parts"; }; - outputs = - { nixvim, flake-parts, ... }@inputs: - flake-parts.lib.mkFlake { inherit inputs; } { + outputs = { + nixvim, + flake-parts, + ... + } @ inputs: + flake-parts.lib.mkFlake {inherit inputs;} { systems = [ "x86_64-linux" "aarch64-linux" @@ -17,32 +20,32 @@ "aarch64-darwin" ]; - perSystem = - { pkgs, system, ... }: - let - nixvimLib = nixvim.lib.${system}; - nixvim' = nixvim.legacyPackages.${system}; - nixvimModule = { - inherit pkgs; - module = import ./config; # import the module directly - # You can use `extraSpecialArgs` to pass additional arguments to your module files - extraSpecialArgs = { - # inherit (inputs) foo; - }; - }; - nvim = nixvim'.makeNixvimWithModule nixvimModule; - in - { - checks = { - # Run `nix flake check .` to verify that your config is not broken - default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule; - }; - - packages = { - # Lets you run `nix run .` to start nixvim - default = nvim; + perSystem = { + pkgs, + system, + ... + }: let + nixvimLib = nixvim.lib.${system}; + nixvim' = nixvim.legacyPackages.${system}; + nixvimModule = { + inherit pkgs; + module = import ./config; # import the module directly + # You can use `extraSpecialArgs` to pass additional arguments to your module files + extraSpecialArgs = { + # inherit (inputs) foo; }; }; + nvim = nixvim'.makeNixvimWithModule nixvimModule; + in { + checks = { + # Run `nix flake check .` to verify that your config is not broken + default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule; + }; + + packages = { + # Lets you run `nix run .` to start nixvim + default = nvim; + }; + }; }; } -